PHP即使它们存在也不加载扩展

时间:2017-10-11 16:08:42

标签: php

我的PHP位于Windows 2012服务器上的路径c:\ php中 我将c:\ php添加到PATH变量。

我在c:\ php \ ext目录中添加了php_pdo_sqlsrv_56_ts.dll

我在c:\ php \ php.ini文件中添加了以下行:

extension_dir = "c:\php\ext"
extension=php_pdo_sqlsrv_56_ts.dll

但是以下命令告诉我它无法找到模块,而它存在于那里:

php --ini
PHP Warning:  PHP Startup: Unable to load dynamic library 'c:\php\ext\php_sqlsrv_56_ts.dll' - The specified module could not be found. in Unknown on line 0

PHP Warning:  PHP Startup: Unable to load dynamic library 'c:\php\ext\php_pdo_sqlsrv_56_ts.dll' - The specified module could not be found. in Unknown on line 0

Configuration File (php.ini) Path: C:\Windows

Loaded Configuration File:         C:\php\php.ini

1 个答案:

答案 0 :(得分:2)

这可能是一个Windows问题,如果DLL本身需要未找到的另一个 DLL,则会将其报告为“不存在”。例如:

php_someextusingssl.dll    - the file exists

但php_someextusingssl.dll需要ssleay32.dll,在运行时找不到。所以你得到的错误是“无法加载php_someextusingssl.dll:找不到文件”。找不到的文件不是php_someextusingssl.dll,而是ssleay32.dll。

如何解决此问题:掌握DEPENDS.EXE等实用程序,并打开行为不当的扩展程序。它应该显示扩展名及其所依赖的所有DLL。 IF 我是对的,那么一个或多个将被标记为红色“缺失”。这些是您需要提供的DLL。

更新1 :有可能缺少的文件属于Microsoft SQL Server Driver page中列出的文件。

更新2 :我已下载了Microsoft驱动程序的副本。您的依赖于ODBC32.DLL,MSVCP110.DLL和MSVCR110.DLL。后两者是x86的Microsoft Visual C ++ 2010 SP1 Redistributable的一部分,您可以找到here。第一部分是根据Update 1列出的ODBC32驱动程序的一部分。