0

我们将 Windows 用于我们的开发系统。我正在手动安装 PHP、Apache、MySQL。全部来自 zip 包。现在:

如果我使用 php线程安全二进制文件:从命令行执行 php.exe 时 pdo_mysql 无法加载。我收到以下警告:

PHP Warning:  PHP Startup: pdo_mysql: Unable to initialize module
Module compiled with module API=20060613, debug=0, thread-safety=0
PHP    compiled with module API=20060613, debug=0, thread-safety=1
These options need to match
 in Unknown on line 0

我检查了我们的 RHEL 生产服务器,那里禁用了 php 线程安全。所以我从这里下载了非线程安全的二进制文件。

现在,我遇到了另一个问题:Apache 无法启动。error.log 说:

[Thu Mar 04 13:54:08 2010] [crit] Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe.  You need to recompile PHP.
Pre-configuration failed
[Thu Mar 04 13:54:08 2010] [warn] (OS 995)The I/O operation has been aborted because of either a thread exit or an application request.  : winnt_accept: Asynchronous AcceptEx failed.

如何在 Windows 中安装支持 pdo_mysql 的 php?那么,命令行 php.exe 有效吗?

注意:在线程安全的二进制文件中,虽然 php.exe 没有加载 pdo_mysql,但 PHP API 能够加载它。因为在phpinfo中,它出现了。

4

1 回答 1

0

对不起!这是愚蠢的。我发现这是问题所在:Apache 使用的是线程安全的 SAPI。命令行使用的是 Zend Core 提供的 php.exe!

我重新配置了“PATH”环境变量:所以现在它指向线程安全包中的 php.exe。问题解决了。

于 2010-03-04T09:41:59.693 回答