Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
595 views
in Technique[技术] by (71.8m points)

winapi - How do I fix PHP module thread-safe/non-thread-safe mismatch?

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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 to ZTS=0 does not work.
You must completely remove the definition of ZTS.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...