Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to try running Apache in a threaded MPM with mod_php. Does anyone have a list of PHP modules that are thread safe so I can tell if its going to be safe to do or not?

share|improve this question
No list for you, but this post on SO might be of interest to you: – squillman Jul 2 '10 at 20:04
up vote 3 down vote accepted

The PHP FAQ explicitely states this is a bad idea. Most libraries it depends on are indeed no thread safe.

If you wish to use Apache worker (I sure do, personally), you might want to investigate running the worker-mpm and PHP5 with FastCGI (mod_fcgid) instead.

The "cgi" part might put you off, but rest assured, mod_fcgid results in great performance, it uses a process pool, where PHP gets its own memory space, completely independent of the web server. This has multiple advantages, including to but not limited to better security (you can run the pool as a different user), better stability (if PHP crashes, it won't take your webserver down with it) and significantly reduced memory for apache processes since they don't have to embed mod_php at all, they just communicate with the pool. It also allows for some unprecedented granularity because of this.

Here's an example tutorial for Debian based systems. I use it in production for various systems, it allows me much more scalability.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.