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

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.

Want to read Linux tips and tricks, but don't have time to check our blog everyday? Subscribe to our daily email newsletter to make sure you don't miss a single tip/tricks. Subscribe to our weekly newsletter here!

{ 10 comments… read them below or add one }

1 Deb 04.27.08 at 8:32 pm

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.

2 Callum 08.03.08 at 11:09 am

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

3 David 10.14.08 at 8:13 am

Thanks, that did it for me.

4 billythekid 12.13.08 at 12:40 am

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

5 Matt 12.30.08 at 4:40 am

This was super useful. Thanks for the post.

6 Mariana 04.06.09 at 11:43 am

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

7 Mariana 04.06.09 at 11:45 am

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”

8 Biju Subhash 04.29.09 at 11:25 am

Thank you for sharing…
nice post..

Biju Subhash

9 Nguyen Lan 05.07.09 at 7:46 pm

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

10 John 05.12.09 at 1:58 am

Thanks so much!

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

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Tagged as: , , , , , , , , , , ,

Previous post: Linux yum command deleted

Next post: Find and Delete File If It Is More Than One Hour Old in UNIX Shell