如何解决PHP模块的线程安全/非线程安全不匹配问题? [英] How do I fix PHP module thread-safe/non-thread-safe mismatch?
问题描述
这超出了错误日志:
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
如何获取PHP的非线程安全源?我在windows.php.net/download上找到的唯一下载链接是 http://windows.php.net/downloads/releases/php-5.3.2-src.zip ,它似乎是线程安全代码---或是否有某种方式告诉源代码真的不是线程安全的?
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?
我曾尝试在命令行上将--disable-zts
放在configure.bat
上,但这虽然对configure.bat
的输出产生了很好的效果,但似乎并没有降低源代码的线程安全性.
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.
推荐答案
在上述情况下,PHP本身是非线程安全(NTS)的,而模块是线程安全(TS)的.该模块是线程安全的,因为定义了Zend Thread-Safe ZTS
常量(在模块的源代码或VS 2008的预处理器定义中).
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).
仅将ZTS=1
更改为ZTS=0
不会起作用 .
您必须完全删除ZTS
的定义.
Simply changing ZTS=1
to ZTS=0
does not work.
You must completely remove the definition of ZTS
.
这篇关于如何解决PHP模块的线程安全/非线程安全不匹配问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!