6

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?

BenMorel
  • 34,448
  • 50
  • 182
  • 322
Paul Erdos
  • 1,355
  • 2
  • 23
  • 47
  • This seems dangerous... disabling thread safety in a web app? – João Aug 06 '10 at 16:07
  • It's store locator software from Ultimate Locator. Not too sure what's going on behind the scenes, but I guess they've got their bases covered? – Paul Erdos Aug 06 '10 at 18:52

4 Answers4

8

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.

Artefacto
  • 96,375
  • 17
  • 202
  • 225
  • This option doesn't exist for PHP 5.2.17, and I can't find anything similar – Amr Mostafa May 12 '11 at 14:40
  • 4
    I found it, it was because installing `apache2-dev` package on my system (Ubuntu) automatically installs `apache2-thread-dev` whose `apxs2` tells the PHP build system to build with thread-safety on. Therefore, the solution was to directly install `apache2-prefork-dev` package. – Amr Mostafa May 12 '11 at 15:02
3

You can download compiled non-thread-safe binaries of PHP for Windows from

Gordon
  • 312,688
  • 75
  • 539
  • 559
2

It is --disable-maintainer-zts command. May try --disable-posix-threads to.

ydk2
  • 112
  • 4
1

You can download the last version of Zend Optimizer which have the thread safety on http://downloads.zend.com/optimizer/3.3.0/ZendOptimizer-3.3.0-linux-glibc23-x86_64.tar.gz