3

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!

bmccall1
  • 79
  • 1
  • 1
  • 7
  • have you looked at the error logs? there should be an error in the log if there is a problem loading an extension – Patrick Evans Oct 02 '13 at 15:14
  • Try changing the `extension_dir` parameter: [PDO drivers no value](http://stackoverflow.com/questions/7086859/pdo-drivers-no-value) – aaron Oct 02 '13 at 15:32
  • I took Patrick's advice and looked at the apache log in /var/log/httpd-error.log. It was complaining that pdo could not be loaded due to it being built not in release mode. (Not debug). I opted to remove debugging from my php installation and changed the configuration of php to no debug. made clean ; made deinstall ; make distclean on php5, php5-extensions and php5-pdo_mysql and remade them all. Got it to work. – bmccall1 Oct 02 '13 at 18:20

1 Answers1

3
  • 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 :)

Tareq
  • 5,283
  • 2
  • 15
  • 18