1

我试图让 PHP 加载一些扩展(PHP PDO 的 sqlsrv 驱动程序)。我正在使用 wamp 服务器,使用 PHP 5.4,Apache 2.4.4。

在我的 PHP.ini 文件中,我输入了以下行:

extension_dir = C:\wamp\bin\php\php5.4.16\ext
...
extension=php_pdo_sqlsrv_54.nts.dll

但是在 apache 错误日志中,每当我重新启动 apache 服务时,都会收到错误消息:

PHP Warning:  PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.4.16/ext/php_pdo_sqlsrv_54_nts.dll' - The specified module could not be found.\r\n in Unknown on line 0

现在,我知道一个事实,这个错误是不正确的。如果我直接从错误日志中复制文件位置 (C:\wamp\bin\php\php5.4.16\ext\php_pdo_sqlsrv_54_nts.dll) 并将其粘贴到 Windows 资源管理器中,它会发现文件正常。

我已将 ext 目录添加到 Windows PATH 环境变量中,但仍然没有成功。

任何想法接下来要尝试什么?谢谢

4

1 回答 1

1

Your problem is that you are trying to run a NTS 'Not Thread Safe' dll with a PHP that is 'Thread Safe', so initially try downloading the Thread Safe version of the sqlsrv DLL.

BIG NOTE and possibly your next problems solution:

As far as I know the sqlserver database interface dlls are only available as 32bit. So if you have installed the 64bit WAMPServer you will have to uninstall and install the 32bit WAMPServer.

于 2013-09-26T14:05:56.887 回答