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

As you know, even if it is possible to start httpd in worker mode under CentOS/RedHat, php in default rpm repo is not thread-safe. And the default configuration for stability is mpm_prefork. So, two questions:

  • Is there PHP accelerator capable of working in mpm_prefork mode (using shm or whatever)?

  • If there is none, what can be done to improve PHP speed on CentOS/RedHat systems (I want to use rpms, preferably from default CentOS repo; building custom PHP from source code is not a good option for me)

share|improve this question
up vote 0 down vote accepted

As long as you are using php <5.3, apc, xcache, eacellerator will all work with prefork. Some require the php5-dev libraries to be installed which should be packaged already, and the opcode caches may already be prepackaged for you.

If you wanted to use worker, you can use fcgid or fastcgi to handle php which would allow you to use worker, and would spawn php-cgi processes to handle your php files.

share|improve this answer
Is, for example, APC effective in prefork? It seems, that it will store php cache per process, right? And each time php-cgi is called, the cache is rebuild, effectively removing all speed-up. – Vladislav Rastrusny Apr 18 '10 at 20:47

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.