php 调用未定义的函数 sqlite_open

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4788853/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 14:22:19  来源:igfitidea点击:

Call to undefined function sqlite_open

php

提问by jmoon

Searched already on many sites with no results. PHP keeps on saying:

已经在很多网站上搜索过,没有结果。PHP 一直在说:

Call to undefined function sqlite_open()

If I manually load sqlite (it's already installed with yum install php-pdo) I get

如果我手动加载 sqlite(它已经安装了yum install php-pdo),我会得到

PHP Warning:  Module 'PDO' already loaded in Unknown on line 0

PHP Warning:  Module 'pdo_sqlite' already loaded in Unknown on line 0

PHP Warning:  Module 'sqlite3' already loaded in Unknown on line 0

PHP Fatal error:  Call to undefined function sqlite_open() in /home/kpark/dbconnect.php on line 9

回答by mario

sqlite_openwas the function in the sqlite2 extension. What you've installed is probably the sqlite3module, which requires sqlite3::open()instead.

sqlite_open是 sqlite2 扩展中的函数。您安装的可能是sqlite3模块,它需要sqlite3::open()代替。

But you should not use the native interface either way. Use PDO to open sqlite databases. http://www.php.net/manual/en/ref.pdo-sqlite.php

但是您不应该以任何方式使用本机接口。使用 PDO 打开 sqlite 数据库。http://www.php.net/manual/en/ref.pdo-sqlite.php