mysql.ini is missing
I'm trying to set up a Wordpress install and am getting "Your PHP installation appears to be missing the MySQL extension which is required by WordPress."
So far as I can tell, php5-mysql is installed. I installed with apt-get and dpkg -l show it as installed.
If I understand it correctly phpinfo() should show the file under "Additional .ini files parsed"
It's not there:
/etc/php5/apache2/conf.d/pdo.ini, /etc/php5/apache2/conf.d/pdo_mysql.ini, /etc/php5/apache2/conf.d/suhosin.ini, /etc/php5/apache2/conf.d/xcache.ini
The file is in fact not in this directory, /etc/php5/apache2/conf.d/ and locate mysql.ini only turns up /etc/php5/conf.d/pdo_mysql.ini.
I decided to see if anyone had suggestions before I went any further.
I'm considering uninstalling and reinstalling php but I would rather not as it seems like that could cause more problems.
Could just create a new mysql.ini file?
Thanks for any suggestions.
9 Replies
php5-mysql does contain /etc/php5/conf.d/mysql.ini, I assume that is what you are looking for?
However, what you should see in phpinfo are MySQL and MySQLi sections. The presence of these will tell you that MySQL extension for PHP is installed and enabled. Check in your php.ini for the lines:
extension=php_mysql.so
extension=php_mysqli.so
If there is a semi-colon in front of those, then the extensions are disabled. Remove the semi-colons, and restart your web server and you should have success.
extension=php_mysql.so
extension=php_mysqli.so
are not in php.ini, so I can't uncomment.
I did try manually adding them but it didn't help.
Makes me think the mysql extension is not enabled ( how would I enable it? ) or it's corrupted. As I mentioned in the first post it appears to be installed.
apt-get purge php5-mysql; apt-get install php5-mysql
then restart apache.