如何获得的Apache2.2从PHP加载SQLite3的类? [英] How to get Apache2.2 load the SQLite3 Class from PHP?

查看:289
本文介绍了如何获得的Apache2.2从PHP加载SQLite3的类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我正在试图让Windows上工作的PHP环境,但由于某种原因Apache是​​不是能够执行如的print_r(:: sqlite3的版本()); ,但是他说致命错误:类'sqlite3的未发现在C:\\ Program Files文件(86) \\的Apache2.2 \\ htdocs中\\的index.php在第8行,而的php.exe 的打印完全正确的输出。

I am currently trying to get a working PHP environment on Windows, but for some reason Apache isn't able to execute e.g. print_r(SQLite3::version());, but says Fatal error: Class 'SQLite3' not found in C:\Program Files (x86)\Apache2.2\htdocs\index.php on line 8, while php.exe prints perfectly correct output.

的php.ini 的我只负载扩展= p​​hp_sqlite3.dll ,没有别的。在的httpd.conf 的我得到了中的PHPIniDirC:/ Program Files文件(86)/ PHP /使Apache来处理诸如<普通的PHP命令code>回声的phpinfo();

In php.ini I only load extension=php_sqlite3.dll, nothing else. In httpd.conf I got PHPIniDir "C:/Program Files (x86)/PHP/" which enables Apache to handle normal php commands like echo phpinfo();.

有谁知道我必须这样做sqlite3的作品通过Apache,也?

Does anybody know what I have to do so SQLite3 works through Apache, too?

在此先感谢!

编辑:

Nevremind,解决了自己:默认的行的extension_dir =转的Windows安装,就必须改变的绝对路径,在我的情况的extension_dir =C:\\ Program Files文件(x86)的\\ PHP \\分机。这使得它所有的工作!

Nevremind, solved it myself: The default line extension_dir = "ext" for Windows installations had to be changed to the absolute path, in my case extension_dir = "c:\Program Files (x86)\PHP\ext". This made it all work!

推荐答案

运行你的的phpinfo(),并检查是否扩展加载,如果没有,检查配置文件(php.ini中)路径加载配置文件来看看它是寻找的php.ini 和文件加载。如果它是正确的,请将 display_startup_errors 在您的INI对和考虑apache的错误日志,看看是否有与装载一些扩展的问题。我猜想,在装船前源码,你需要加载php_mbstring.dll

Run your phpinfo() and check if extension is loaded, if not, check Configuration File (php.ini) Path and Loaded Configuration File to see where it is looking for php.ini and which file is loaded. If it is correct, set display_startup_errors in your ini to on and look into apache error log to see if there are problems with loading some extension. I would guess that prior to loading sqlite you will need to load php_mbstring.dll

这篇关于如何获得的Apache2.2从PHP加载SQLite3的类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆