Home | News | Download | Packages | Forum | Wiki | Github

[SOLVED] PHP7 error installing WordPress


I try to install WordPress in my Void Linux system, but I get this error at the final step:

[php7:error] [pid 1522] [client] PHP Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /srv/www/apache/wp-includes/ wp-db.php:1570\nStack trace:\n#0 /srv/www/apache/wp-admin/setup-config.php(274): wpdb->db_connect()\n#1 {main}\n thrown in /srv/www/apache/wp-includes/wp-db.php on line 1570, referer: http://localhost/wp-admin/setup-config.php?step=1&language=es_ES

I’ve read that mysql_* functions have been removed in PHP7 and that mysql_connect() has been deprecated since PHP v5.5.0.

How to fix?

(Stefan Mühlinghaus) #2

Current versions of WordPress support PHP 7. If you absolutely need to get an old version of WordPress running, the simplest way is probably to use XAMPP with PHP 5.6.


I would use XAMPP, but my system is 32-bit. XAMPP is currently 64-bit only.

(Stefan Mühlinghaus) #4

True. The next easiest way I found was via Docker. I used that once and it worked satisfactory. It is somewhat more difficult though. Maybe this apache2-php5 Docker image can help you?

Aside from that you probably would have to compile PHP yourself, one way or another.


I installed php-mysql. That did the trick. Marked as solved.