I recently deployed a new WordPress installation to my existing production webserver running Apache, MySQL and PHP for other websites, yet I was presented with the following message.
“Your PHP installation appears to be missing the MySQL extension which is required by WordPress.”
This thread at wordpress.org did not help me, however I was able to solve the problem, but this thread is now marked as closed. That’s poor form because I can’t share the solution I found.
My PHP configuration file did not have the following.
#php.ini [PHP] extension=mysql.so
Adding this and restarting Apache did not fix the problem.
The problem was more fundamental and required PHP to be recompiled. Orginally PHP was configured with the ‘–with-mysqli’ option. PHP requires the ‘–with-mysql’ which is rather stupid they have this dependency.
Recompiling PHP and adding the necessary extension were both necessary to get my new WordPress installation operational.
Des says
I also have ran into this problem before. I took a different and easier solution then recompiling php to support the older mysql library.
A few different people have created a new db.php file that uses the new mysqli library which replaces the older one. You just place it in the /wp-content/ directory and your done.
A quick search for “wordpress mysqli” gives several links on this solution.
John Flower says
Hi,
I use Wampserver on my machine. I got this error for the first time ever today. How do you recompile PHP? Can I recompile PHP on Wampserver?
Thanks.