PHP PDO Mysql not loading. extension is in extensions.ini, php_thesql.so exists, but phpinfo only shows sqlite and dblib

MySQLpdoPHP

I'm trying to get the mysql php pdo to work on FreeBSD 9.1.

Mysql version: 5.5.28
PHP Version: 5.4.7

Applicable Contents of Extensions.ini:

extension=pdo_dblib.so
extension=mysql.so
extension=pdo.so
extension=pdo_mysql.so
extension=pdo_sqlite.so

PHP Info:

PDO support enabled
PDO drivers dblib, sqlite

PDO Driver for FreeTDS/Sybase DB-lib enabled
Flavour freetds

PDO Driver for SQLite 3.x enabled
SQLite Library 3.7.14.1


So, no pdo_mysql.so being loaded, even though the file exists, its in the extensions file etc. I've even tried commenting out the pdo.so and mdo_sqlite.so just to make sure the correct extension file was being loaded and for certain… It is.

Any ideas?

Thanks!

Best Answer

  • Check which php.ini loaded and if it is the same one you are modifying. on cli, do:

php -i | head |grep -i loaded

Or in some dummy php file:

<?php
phpinfo();
?>

and then open that dummy file in the browser

  • Make sure the php mysql support package is installed.

search for it (I am using ubuntu):

apt-cache search php5*|grep mysql

Install it (mine happened to be php5-mysql and i think yours would be the same too):

sudo apt-get install php5-mysql

check again after installing it if you get what you want :)