简体   繁体   English

MAMP没有SQLite

[英]MAMP doesn't have SQLite

I've installed and reinstalled MAMP and it doesn't seem like sqlite is being included. 我已经安装并重新安装了MAMP,似乎并没有包含sqlite。 I've searched the httpd.conf with no results. 我搜索了httpd.conf没有结果。 I thought I was supposed to add the 我以为我应该添加

extension=php_pdo.so
extension=php_pdo_sqlite.so
extension=php_sqlite.so

but the extensions aren't even in the MAMP directory so adding the above lines does nothing. 但扩展甚至不在MAMP目录中,因此添加上述行不会做任何事情。 Based on the MAMP website documentation SQLite is included in the install, but I'm not seeing it anywhere and I'm having no luck getting it to work. 基于MAMP网站文档,SQLite包含在安装中,但我没有在任何地方看到它,我没有运气让它工作。 The issue arises when I load a page that refers to the SQLiteDatabase class and my php error log says 当我加载一个引用SQLiteDatabase类的页面并且我的php错误日志说明时,会出现问题

PHP Fatal error:  Class 'SQLiteDatabase' not found in /var/www/queries.php on line 67

No, MAMP does not have SQLite. 不,MAMP没有SQLite。 Not sure why you say that. 不知道你为什么这么说。 Based on the MAMP website documentation SQLite is included, but actually list the packages and SQLite is not there. 基于MAMP网站文档包含了SQLite,但实际列出了包,SQLite不在那里。

Note that SQLite is installed by default on OS X as part of the operating system (as well as Apache and PHP). 请注意,默认情况下,SQLite作为操作系统(以及Apache和PHP)的一部分安装在OS X上。

I fixed the issue based on @drew010's comments. 我根据@ drew010的评论修正了这个问题。 Even though SQLiteDatabase is listed on the PHP website, it doesn't seem like it's working properly. 即使SQL网站上列出了SQLiteDatabase,它似乎也不能正常工作。 I changed to new SQLite3() and it seems to be working now. 我改为新的SQLite3(),它现在似乎正在运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM