[TriLUG] apache2 and PHP5

Scott Lundgren trilug at capitalfellow.com
Thu Jul 7 16:12:28 EDT 2005


Ryan,

PHP is not an MPM. The core of PHP5 is thread safe. Some of the 
libraries (i haven't found documentation that says which ones) are not 
thread safe. Apache2 allows you to use the worker MPM (threaded) or you 
could use the pre-fork MPM (non-threaded). To the best of my 
understanding using the pre-fork MPM means Apache2 performs similar to 
Apache 1.3x. So the potential for a race condition in your application 
is

web application that relies on being multi-threaded + Apache2 + Worker 
MPM + calling one of the non-thread safe libraries

I'm running Apache2 + Worker MPM + PHP5. Your mileage may vary.

- SL

> For the longest time I was reading warnings against using PHP with 
> Apache2 in a production environment.  While I heeded the warnings for 
> my production servers, I never had a problem running it on any dev 
> servers and seemed stable.  But, my question now is, are these 
> warnings still present with the release of PHP5?  I found some stuff 
> that warned against using PHP as a MPM, but can I assume that running 
> apache2 with php compiled in is ok?? I could be very behind the times 
> here, but just wanted to ask.
>
> thanks,
> rtw
> -- 
> TriLUG mailing list        : 
> http://www.trilug.org/mailman/listinfo/trilug
> TriLUG Organizational FAQ  : http://trilug.org/faq/
> TriLUG Member Services FAQ : http://members.trilug.org/services_faq/
> TriLUG PGP Keyring         : http://trilug.org/~chrish/trilug.asc




More information about the TriLUG mailing list