Re: How to detect if PHP was built with thread safety (ZTS)?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

2016-04-04 2:27 GMT+02:00 lj <lj308@xxxxxxxxx>:
> Is there any way a PHP script can tell if the PHP it is running under was
> built with thread safety (ZTS)?  I have some test code that would like to
> know. I don't see any constant, function, etc. that can be used to directly
> check if ZTS is enabled.  The only way I've found is ob_start,
> phpinfo(INFO_GENERAL), then check the buffer for "Thread Safety" followed
> by Enabled or Disabled.  Kind of ugly, and fragile.  Is there a better way?

As of PHP 5.2.7 the PHP_ZTS constant is available for exactly this


-- 
regards,

Kalle Sommer Nielsen
kalle@xxxxxxx

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux