如何修复 PHP 模块线程安全/非线程安全不匹配的问题?
这是错误日志中的内容:
PHP Warning: PHP Startup: BOPEE Extension: Unable to initialize module
Module compiled with build ID=API20090626,TS,VC9
PHP compiled with build ID=API20090626,NTS,VC9
These options need to match
in Unknown on line 0
PHP Warning: PHP Startup: CustomExt Module: Unable to initialize module
Module compiled with build ID=API20090626,TS,VC9
PHP compiled with build ID=API20090626,NTS,VC9
These options need to match
in Unknown on line 0
How I get the non-threadsafe source for PHP?我在 windows.php.net/download 上找到的唯一下载链接是 http://windows.php.net/downloads/releases/php-5.3.2-src.zip 这似乎是线程安全代码 --- 或者是否有某种方法告诉源代码它是实际上是非线程安全的?
我尝试将 --disable-zts
放在 configure.bat
的命令行上,但这对 configure.bat
的输出有很好的效果>,它似乎并没有使源的线程安全性降低。
This is out of the error log:
PHP Warning: PHP Startup: BOPEE Extension: Unable to initialize module
Module compiled with build ID=API20090626,TS,VC9
PHP compiled with build ID=API20090626,NTS,VC9
These options need to match
in Unknown on line 0
PHP Warning: PHP Startup: CustomExt Module: Unable to initialize module
Module compiled with build ID=API20090626,TS,VC9
PHP compiled with build ID=API20090626,NTS,VC9
These options need to match
in Unknown on line 0
How I get the non-threadsafe source for PHP? The only download link I found on windows.php.net/download was http://windows.php.net/downloads/releases/php-5.3.2-src.zip and that appears to be the threadsafe code --- or is there some way of telling the source that it's actually non-threadsafe?
I have tried putting --disable-zts
on the commandline for configure.bat
but whilst that has a good effect on the outputs from configure.bat
, it doesn't seem to make the source any less threadsafe.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在上面的例子中,PHP 本身是非线程安全的(NTS),但模块是线程安全的(TS)。该模块是线程安全的,因为定义了 Zend 线程安全
ZTS
常量(在模块的源代码中或在 VS 2008 的预处理器定义中)。仅将
ZTS=1
更改为ZTS=0
并不起作用。您必须完全删除
ZTS
的定义。In your case above, PHP itself is non-thread-safe (NTS), but the module is thread-safe (TS). The module is thread-safe because the Zend Thread-Safe
ZTS
constant is defined (either in the module's source code or in VS 2008's Preprocessor Definitions).Simply changing
ZTS=1
toZTS=0
does not work.You must completely remove the definition of
ZTS
.