Portal Home > Knowledgebase > Articles Database > Apache worker MPM & PHP


Apache worker MPM & PHP




Posted by RandomThoughts, 10-22-2009, 05:45 AM
I've read that the Apache worker MPM is more resourse friendly but breaks PHP. Is there any way of getting the two to work together? Thanks for looking

Posted by Lightwave, 10-22-2009, 06:05 AM
From the FAQ: Why shouldn't I use Apache2 with a threaded MPM in a production environment? PHP is glue. It is the glue used to build cool web applications by sticking dozens of 3rd-party libraries together and making it all appear as one coherent entity through an intuitive and easy to learn language interface. The flexibility and power of PHP relies on the stability and robustness of the underlying platform. It needs a working OS, a working web server and working 3rd-party libraries to glue together. When any of these stop working PHP needs ways to identify the problems and fix them quickly. When you make the underlying framework more complex by not having completely separate execution threads, completely separate memory segments and a strong sandbox for each request to play in, feet of clay are introduced into PHP's system. If you feel you have to use a threaded MPM, look at a FastCGI configuration where PHP is running in its own memory space. And finally, this warning against using a threaded MPM is not as strong for Windows systems because most libraries on that platform tend to be threadsafe.

Posted by barry[CoffeeSprout], 10-22-2009, 07:19 AM
Yes, as said you should use mod_fastcgi and a fastcgi capable php. You check php by issuing: php -i | grep fastcgi of php-cgi -v mod_fastcgi is probably included in your install. You can learn more about setting this up on: http://www.cyberciti.biz/tips/rhel-c...iguration.html

Posted by PCS-Chris, 10-22-2009, 08:01 AM
I've never had any problems with worker mpm breaking php? Just make sure you use threaded modules. I tend to use mpm_prefork on smaller servers and mpm_worker on all larger servers, and the performance is excellent.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
Phlint down? (Views: 699)

Language: