1
votes

I'm trying to make something with PHP and sqlite. I've got both the sqlite3 and pdo_sqlite3 libraries loaded (according to php -m), the php.ini gets the libraries added, but I still get the fatal error that the function (whether it's sqlite_open() or sqlite_versioninfo()) isn't found. phpinfo() shows that both libraries are loaded. So why can't I use them?

Some info about my setup:

I'm running on debian, I'm running Apache2 and PHP 5.4.4-4. I can't remember how I installed PHP (apparently not through apt-get), but it's launched through Apache.

The output of php -m:

root@ns:~# php -m [PHP Modules] bcmath bz2 calendar Core ctype curl date dba dom ereg exif fileinfo filter ftp gettext hash iconv imagick json libxml mbstring mhash mysql mysqli openssl pcntl pcre PDO pdo_mysql pdo_sqlite Phar posix Reflection session shmop SimpleXML soap sockets SPL sqlite3 ssh2 standard sysvmsg sysvsem sysvshm tokenizer wddx xml xmlreader xmlwriter zip zlib

[Zend Modules]

The exact error text is PHP Fatal error: Call to undefined function sqlite_libversion() in [file] on line 14 and it occurs both through the command line and the webserver.

If I think of anything else to add, I'll add it here.

2
the fatal error comes from a script run via the command line, or via a webserver?goat
@rambocoder I updated my question. It occurs both through the command line and the webserver.demize

2 Answers

1
votes

Your using functions from the sqlite extension, but you enabled the separate sqlite3 extension.

and pdo_sqlite3 is only for pdo.

0
votes

If you are running php with php-fpm, and compiled the library after the php-fpm started, you should restart the php-fpm, then the new library will be effet.