Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wordpress localhost installation error - Your PHP installation appears to be missing the MySQL extension which is required by WordPress

I know this question has been asked N number of times but I can't seem to get it worked. I am trying to install wordpress on my local VM machine. I have mysql running fine as shown below.

    vishal@ubuntu:/etc/apache2$ mysql -u root -p
    Enter password: 
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 39
    Server version: 5.1.41-3ubuntu12.10 (Ubuntu)

    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

     mysql>

Despite multiple attempts I am getting below error : "Your PHP installation appears to be missing the MySQL extension which is required by WordPress"

I have tried to uncomment extension_dir with exact path of myql.so and put extension as mysql.so.

I have two php.ini files which I am not sure correct or not. One is present in /etc/apache2 /phi.ini and second is present in /etc/php5/cli/php.ini.

There is no php.ini file in /etc/php5. I tried installing many times but it does not appear there.

Both are referring to actual mysql.so library path and mention extension as mysql.so

Could anyone please suggest what could possibly going wrong ? Thank you !

like image 358
Vishal Avatar asked Dec 17 '13 06:12

Vishal


People also ask

How install MySQL extension in PHP INI?

Open the file with an editor. Enable or add the following configuration parameters to the file. MySQL extensions are . dll files on the Windows environment that are located in the ext folder of the PHP installation directory.

What is PHP MySQL extension?

The PHP MySQL extensions are lightweight wrappers on top of a C client library. There are 3 PHP MySQL extensions: ext/mysql (not recommended) ext/mysqli. PDO_MySQL.


1 Answers

Install your mysql library for php, run:

 sudo apt-get install php5-mysql

And restart apache:

 sudo service apache2 restart

Retry Wordpress installation!

like image 62
Ignacio Ocampo Avatar answered Oct 27 '22 11:10

Ignacio Ocampo