Your PHP installation appears to be missing the MySQL extension which is required by WordPress

by Vivek Gite on April 19, 2008 · 19 comments

Q. I'm installing WordPress blog system under Debian Linux and getting an error which read as follows:

Your PHP installation appears to be missing the MySQL extension which is required by WordPress

How do I fix this problem under Debian Linux?

A.. First make sure MySQL server is running, type the following command at a shell prompt:
# /etc/init.d/mysql status
If MySQL is not running, enter:
# /etc/init.d/mysql start
If MySQL is not installed, type the following command to install MySQL server:
# apt-get install mysql-server
Make sure MySQL module for php5 is installed:
# dpkg --list | grep php5-mysql
To install php5-mysql module enter:
# apt-get install php5-mysql
Just restart Apache2 web server:
# /etc/init.d/apache2 restart
Now PHP support for MySQL should work without a problem. Also make sure you set localhost or 127.0.0.1 as MySQL hostname while performing wordpress installation.

Featured Articles:

Share this with other sys admins!
Facebook it - Tweet it - Print it -

{ 19 comments… read them below or add one }

1 Deb April 27, 2008

I’m having the same problem trying to install on my localhost in Windows XP environment – any tips on how to fix that? I tried the above and that didn’t work. I’m running Apache 2 and PHP MyAdmin 5.2 (I believe). Everything else works fine and I can create and access MySQL databases in PHP MyAdmin without any issues.

Reply

2 Callum August 3, 2008

The reason it didn’t work is because this is for a linux environment, not Windows.

Reply

3 David October 14, 2008

Thanks, that did it for me.

Reply

4 billythekid December 13, 2008

Thanks for this, I’ve been trying various “fixes” all night, this did the trick for me. Props!

Reply

5 Matt December 30, 2008

This was super useful. Thanks for the post.

Reply

6 Mariana April 6, 2009

I am trying to install wordpress under debian.
It is not my first installation, neither the second. It always gone ok.
Not I got the same error pointed out here (you can go to the website). I do have php-server installed and running, I do have php5 installed. I do have the module php5-mysql.

And it still gives me the same error.

Who can help me?

Thanks, Mariana

Reply

7 Mariana April 6, 2009

Sorry I wrote “Not I got the same error ..”, I meant “Now I got the same error..”

And also “I do have php-server installed and running”, I meant “I do have mysql-server installed and running”

Reply

8 Biju Subhash April 29, 2009

Thank you for sharing…
nice post..

Biju Subhash

Reply

9 Nguyen Lan May 7, 2009

Thanks for shared but I host on godaddy so How can I do with this problem. My host is shared hosting on Window. Can you show me.
Thanks

Reply

10 John May 12, 2009

Thanks so much!

Followed your process, step by step. Worked like a charm first time!

Reply

11 aldeol July 13, 2009

Thank you so much. I have solved my problem. Thank you again for this useful article…

Reply

12 BentleyCoup August 15, 2009

Thanks i stumbled on the same problem. One would think that the mysql module would be included with PHP5 without asking for it.

Reply

13 Jasper December 16, 2009

Thanks. This was a life saver for my local installation on a Ubuntu Virtual Partition!

Reply

14 lacops June 10, 2010

So simple and yet such a great help!

Thank you so much :-)

Reply

15 blesbok June 11, 2010

Thank you, this was very handy. Turned out all that was left to do was to restart Apache. Almost felt I could kick myself…

Reply

16 Phoreys July 21, 2010

Nice! That fixed my issues…

Reply

17 John Connor September 27, 2010

Thanks, that solved my problem.

Reply

18 PB April 11, 2011

This fixed it for me. Gracias!

Reply

19 Ghostetr January 4, 2012

THANKS THIS WAS A HUGE HELP :D
hehe i just reinstalled my ubunto and updated to version 11.10
i had install the mysql extension but forgot to start it
ty for your help :D

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <blockquote> <pre> <a href="" title="">
What is 7 + 2 ?
Please leave these two fields as-is:
Solve the simple math so we know that you are a human and not a bot.




Previous post:

Next post: