I am using some software that requires me to have thread safety disabled. I am working on a Windows server. From what I've read elsewhere, I can't just configure this in the .ini file. Is this true? If so, how would I compile it so that thread safety is turned off?
What does thread safety mean when downloading PHP? Thread Safety means that binary can work in a multithreaded webserver context, such as Apache 2 on Windows. Thread Safety works by creating a local storage copy in each thread, so that the data won't collide with another thread.
If you are unknown which version of PHP is installed in your system then there is an easy way to know that. Check the version of installed PHP Thread safe or Non Thread Safe: Open a phpinfo() and search for the line Thread safety for a thread-safe build you should find enable.
It means when multiple threads executing simultaneously, and want to access the same resource at the same time, then the problem of inconsistency will occur. so synchronization is used to resolve inconsistency problem by allowing only one thread at a time. Synchronization uses a synchronized keyword.
You have to compile PHP with ZTS disabled (compile flag --disable-zts
) or download binaries with ZTS disabled.
This won't work properly in some webservers, namely those which process several PHP scripts simultaneously in the same process.
You can download compiled non-thread-safe binaries of PHP for Windows from
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With