douzhajie7168 2012-12-25 18:30
浏览 63
已采纳

为什么PHP在运行脚本时不会看到sqlite库?

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条回答 默认 最新

  • dtla92562 2012-12-25 18:57
    关注

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

    and pdo_sqlite3 is only for pdo.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)
编辑
预览

报告相同问题?