1

I have found that a manually installed (compiled) PHP 5.6.34 on Ubuntu Server 16.04 has automatically enabled thread safety.

The source is downloaded from php.net. Here is the build commands I have used:

$ ./configure --prefix=/opt/php56 --disable-posix --enable-soap --enable-mbstring --enable-mbregex --with-gd --with-jpeg-dir="/usr/lib/x86_64-linux-gnu" --enable-zip --enable-bcmath --enable-pcntl --enable-ftp --enable-exif --enable-calendar --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-static --enable-wddx --enable-shmop --with-curl --with-mcrypt --with-iconv --with-pspell --with-zlib --with-freetype-dir=/usr --enable-gd-native-ttf --enable-gd-jis-conv --with-openssl --with-pdo-mysql --with-gettext=/usr --with-bz2=/usr --with-recode=/usr --with-apxs2=/etc/apache2/bin/apxs --with-fpm-user=www-data --with-fpm-group=www-data --enable-fpm
$ make
$ make install

I have tried with --disable-zts, no change occurred. How can I compile with thread safety disabled?

And one side but still important question - is there a way to check if extension is thread safe?

Thank you!

kanevbgbe
  • 113
  • 5
  • 12
  • @Raptor thank you for the edition – kanevbgbe Mar 13 '18 at 08:56
  • Worth to read [this](https://stackoverflow.com/a/5978844/188331) about thread safety. Thread safety disabled doesn't mean it runs on single thread. What are you trying to achieve? `phpinfo()` page will tell you whether PHP is running in thread-safe or non-thread-safe mode. – Raptor Mar 13 '18 at 09:49
  • Mainly to compile with disabled multi-threading support and to understand why it is enabled by default. – kanevbgbe Mar 13 '18 at 10:05
  • I guess PHP cannot be single threaded, as it is designed to handle multiple scripts at the same time. – Raptor Mar 14 '18 at 01:32
  • This is totally wrong guess – kanevbgbe Mar 14 '18 at 08:06
  • https://serverfault.com/questions/901552/php-multi-threading-support-is-auto-enabled-how-to-compile-with-disabled – kanevbgbe Mar 23 '18 at 07:20

0 Answers0