Apache 2 and PHP
by
dananderson
·
· Score: 5, Informative
OK--I'll answer the obligatory question before it's asked:-): Does Apache 2 work with PHP yet?
A: Yes, but only if you use the (default) Apache prefork module with PHP. Some libraries used by PHP are
not thread-safe, so you cannot use the multiple thread model.
For details on using Apache 2 and php see my FAQ at
http://dan.drydog.com/apache2php.html
Re:Apache 2 and PHP
by
Fweeky
·
· Score: 4, Interesting
PHP itself is thread safe (that's what the Thread Safe Resource Manager is all about); if your extension use is limited, it should work fine in a threaded MPM.
A better solution IMO is to use FastCGI; mod_fastcgi is thread safe, and it seperates PHP (and pretty much any other language) from the webserver so you can't make the webserver blow up with a badly written script, as well as using fewer resources since there's no need for a 1:1 mapping between webserver processes and PHP processes. You can even host your PHP on a seperate machine, or a cluster of them, without having to manage webservers on them all.
Re:Apache 2 and PHP
by
Fweeky
·
· Score: 4, Informative
Any noticable speed loss is unlikely; that you need fewer PHP processes and database connections eating memory could actually make it faster.
There's no need for #! lines in your.php files; the interpreter loads whatever SCRIPT_FILENAME is set to by the webserver. With external servers you don't even need the.php's to be in the webserver's document tree; your PHP interpreter(s) can be running in a seperate part of the filesystem, a chroot jail or even a seperate server; even load balanced across many servers using something like the pen load balancer or lighttpd and its native lb support.
Not necessarily the simplest or most sensible setup for small sites/development, but it works well in more loaded setups.
Re:Least Commented Story
by
molnarcs
·
· Score: 4, Funny
It is because of your comment. Now that you have drawn attention to the fact that this is the least commented story, readers are tentative (myself included) to post new comments for fear of ruining this new record;)
"This version of Apache is principally a bug fix release.
This release is compatible with modules compiled for 2.0.42 and later versions.
We consider this release to be the best version of Apache available and encourage users of all prior versions to upgrade."
Just finished upgrading:)
A: Yes, but only if you use the (default) Apache prefork module with PHP. Some libraries used by PHP are not thread-safe, so you cannot use the multiple thread model.
For details on using Apache 2 and php see my FAQ at http://dan.drydog.com/apache2php.html
"This version of Apache is principally a bug fix release.
:)
This release is compatible with modules compiled for 2.0.42 and later versions.
We consider this release to be the best version of Apache available and encourage users of all prior versions to upgrade." Just finished upgrading