Find if the installed PHP is threadsafe or nonthreadsafe?
How do I find out whether the installed version of PHP is threadsafe or not thread safe?
Please note that I'm not asking the difference between a threadsafe/non thread safe installation. I would like to find out what is installed currently.
Verified Answer (164 Votes) ✓
Open a phpinfo() and search for the line Thread safety. For a thread-safe build you should find enable.
As specified in the comments by Muhammad Gelbana you can also use:
- On Windows :
php -i|findstr "Thread"
- On *nix:
php -i|grep Thread
Answer #2 (22 Votes)
If you prefer to use the command line:
php -i | grep -i "Thread"
php -i | findstr -i "thread"
This should give you something like this:
Thread Safety => enabled
Thread Safety => disabled
Answer #3 (4 Votes)
Create a new PHP file and insert this code in it:
<?php phpinfo(); ?>
Then run this page and you will find all of the PHP information. Search for the term that you want, and it will show you it's enabled.