PHP PDO扩展无法在IIS上运行 [英] PHP PDO extension not working on IIS

查看:185
本文介绍了PHP PDO扩展无法在IIS上运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用__autoload()来加载类的脚本(愚蠢的,我知道,这是我曾经用于娱乐/测试的旧代码),它似乎试图自动加载PDO。这让我相信它没有找到它应该的PDO类。我已经检查了php.ini并启用了php_pdo.dll,以及php_pdo_mysql.dll等.dd文件中存在.dll文件,我已经多次重启Web服务器。

I have a script which uses __autoload() to load classes (stupid, I know, this is old code I used to use for fun / testing), and it seems to be trying to autoload PDO. This leads me to believe that it's not finding the PDO class it should be. I have checked php.ini and php_pdo.dll is enabled, along with php_pdo_mysql.dll, etc. The .dll files exist in "ext/" and I've restarted the web server numerous times.

我对IIS没有多少经验,但我从来没有在Linux上遇到过这个问题,所以我不确定是什么问题。

I don't have much experience with IIS, but I've never had this issue on Linux, so I'm not sure what the issue is.

非常感谢任何帮助。

编辑:PDO不在 phpinfo()。我知道它没有正确加载,我正在试图找出原因。这是我的php.ini文件: Pasebin上的php.ini

EDIT: PDO is not in phpinfo(). I know it's not loaded correctly, I'm trying to figure out why. Here is my php.ini file: php.ini on Pasebin

C: \Program Files(x86)\PHP \ _ext是扩展名目录,在php.ini和 phpinfo()中列出。

C:\Program Files (x86)\PHP\ext is the extension directory, and listed as such in php.ini and phpinfo().

推荐答案

我发现奇怪的一点是你在 [PDO]中指定了扩展名部分。我不知道这种表示法 - 我的Windows php.ini不会这样做。可能是该行被忽略,因为它被解释为 PDO.extension 这是没有意义的。

One thing I find odd is that you are specifying the extension in the [PDO] section. I'm not aware of this kind of notation - my Windows php.ini doesn't do that. It could be that the line gets ignored because it gets interpreted as PDO.extension which doesn't make sense.

如果将 extension = php_pdo.dll 位移动到INI文件的主体(在任何 [] 部分)?

What happens if you move the extension=php_pdo.dll bit into the main body of the INI file (outside any [] section)?

如果这不会改变任何东西:
您是否100000确定您正在编辑正确的php.ini?

If that doesn't change anything: Are you 100000% sure you are editing the correct php.ini?

使用文件中指定的扩展名,PHP应该在重新启动服务器时崩溃,或者给你PDO类。

With the extension specified in the file, PHP should either crash when you restart the server, or give you the PDO class.

检查 phpinfo(),看看究竟正在使用哪个ini文件。

Check phpinfo() to see which ini file is being used exactly.

这篇关于PHP PDO扩展无法在IIS上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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