Jump to content

SQLite PHP5 undefined function sqlite_*


adamchal

Recommended Posts

I'm using CentOS 4.4. I have the following packages installed and setup correctly:

 

[dev:~] # yum list|grep pdo

php-pdo.i386 5.1.6-3.el4s1.5 installed

 

[dev:~] # yum list|grep sqlite

sqlite.i386 3.3.3-1.2 installed

sqlite-devel.i386 3.3.3-1.2 installed

 

Also, I have this in my php.ini file (just to make sure that pdo.so and pdo_sqlite.so were loaded):

 

extension=pdo.so

extension=pdo_sqlite.so

 

When I look at the 'phpinfo()', I see PDO and PDO SQLite in the output:

 

PDO

PDO support enabled

PDO drivers sqlite, mysql

 

pdo_sqlite

PDO Driver for SQLite 3.x enabled

PECL Module version (bundled) 1.0.1 $Id: pdo_sqlite.c,v 1.10.2.6 2006/01/01 12:50:12 sniper Exp $

SQLite Library 3.2.8

 

However, when I use any of the sqlite functions, ie. sqlite_popen('sqlite_db'), I see this in the Apache error log:

 

...PHP Fatal error: Call to undefined function sqlite_popen()...

 

I get the same thing from the command line. Even more, I can use the sqlite command line utility and I have successfully created an sqlite3 db and it works completely. It seems that PHP will just not recognize those sqlite functions.

 

Check this out:

 

[dev:~] # echo "<? print_r(get_defined_functions()) ?>"| php|grep -i pdo

[1222] => pdo_drivers

 

[dev:~] # echo "<? print_r(pdo_drivers()) ?>"| php|grep -i pdo[dev:~] # echo "<? print_r(pdo_drivers()) ?>"| php

Array

(

[0] => mysql

[1] => odbc

[2] => sqlite

)

 

[dev:~] # echo "<? print_r(get_defined_functions()) ?>"| php|grep -i sqlite

[dev:~] #

 

Nothing.

 

I'm at a loss! I couldn't find any documentation anywhere about this. Anybody have any experience with this?

Link to comment
https://forums.phpfreaks.com/topic/48725-sqlite-php5-undefined-function-sqlite_/
Share on other sites

This may be the problem

 

http://sg.php.net/manual/en/ref.pdo-sqlite.php

 

My understanding of the docs is that sqlite version 2 uses the old interface, but sqlite version 3 must use the PDO interface, not the direct sqlite interface (and the sqlite_* functions)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.