On Oct 4, 2009, at 18:37, M. Brooks Clark wrote:

I have installed php5 along with php5-sqlite. When I try to access a mysql database using PHP, however, I get an exception.

The line to open the database is:

$db = new PDO("sqlite:/opt/local/var/wview/archive/ weatherAverages.sqlite");

The exception I get is:

"could not find driver"


Am I missing something in my config files and/or is there something else I need to include in the php code?

I'm running MacPorts v1.8.1 on Snow Leopard.


Does sqlite support show up in phpinfo, like this?


$ php -r 'phpinfo();' | grep sqlite
/opt/local/var/db/php5/sqlite.ini,
PDO drivers => mysql, odbc, oci, sqlite, sqlite2
pdo_sqlite
PECL Module version => 2.0-dev $Id: sqlite.c,v 1.166.2.13.2.9.2.22 2009/06/25 09:38:04 johannes Exp $
sqlite.assoc_case => 0 => 0
sqlite3
sqlite3.extension_dir => no value => no value


If not, check your php.ini for a line beginning with "extension_dir". If you find one, remove it, as it can interfere with loading the extensions.




Thanks. The extension_dir line was not commented out in my php.ini file:

extension_dir = "./"

Looks like that did it.
_______________________________________________
macports-users mailing list
macports-users@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macports-users

Reply via email to