php5 and sqlite
M. Brooks Clark
brooks at clarksonline.net
Sun Oct 4 18:06:55 PDT 2009
>
> 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-users/attachments/20091004/c40ca191/attachment.html>
More information about the macports-users
mailing list