FastCGI for PHP in Apache2
I'm new to VPS and have an issue. I'm trying to setup FastCGI to run PHP files for Apache2. I'm trying to setup a Joomla site and have no knowledge of nginx so I've stayed away from it. I can't see to find a tutorial on how to setup FastCGI.
I found a couple tutorials online but they seemed incomplete. Each time when I finished, I was getting 500 server errors for PHP files. I haven't been able to get PHP5 to work either.
I'm running Debian 5. Does anyone know of a tutorial that is good to setup FastCGI?
7 Replies
Is there a particular reason you're specifying FastCGI, or will your applications work under the commonly-used Apache/mod_php combination?
The tutorials in the library are quite useful, by the way.
It should be noted that modphp, modperl, and other modules exist to solve the same problem of having to load an interpreter for each script request. In all likelihood, if you're running Apache, mod_php will serve your needs just fine. Our Debian LAMP guide covers setting up a web server in this fashion:
Thanks for the compliments on the Library
@pparadis:
It should be noted that modphp, modperl, and other modules exist to solve the same problem of having to load an interpreter for each script request. In all likelihood, if you're running Apache, mod_php will serve your needs just fine. Our Debian LAMP guide covers setting up a web server in this fashion:
http://library.linode.com/lamp-guides/debian-5-lenny/
At the expense of wasting memory, sure. mod_php will load PHP into every single Apache process even if they're serving up static content.
> At the expense of wasting memory, sure. modphp will load PHP into every single Apache process even if they're serving up static content.
It's important to look at a site's actual requirements and understand the tuning options available in Apache before deciding to throw modphp out over something like this. Many high traffic sites use it without any issues, and the actual traffic expected on a site should be taken into consideration, with load testing, before making such a call.
If optimizing the memory footprint and overall performance is critical, it's always possible to offload static content to something else, such as nginx or another web server daemon, without having to use it for everything. This has also been a common practice for high traffic sites.
Edit/addition:
For sites with very high traffic, it is often highly desirable that they be hosted on more than one web server for traffic management and redundancy purposes. One method of accomplishing this is discussed here: Build a Highly Available HTTP Load Balancer on Ubuntu 10.04 LTS (Lucid)