Installing Lighttpd With PHP5 Support On CentOS
Lighttpd is a secure, fast, standards-compliant web server designed for speed-critical environments. This tutorial shows how you can install Lighttpd on a CentOS 5.0 server with PHP5 support (through FastCGI) and MySQL support.
rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
Afterwards, we can install Lighttpd like this:
yum install lighttpd
Then we create the system startup links for Lighttpd (so that Lighttpd starts automatically whenever the system boots) and start it:
chkconfig –levels 235 lighttpd on
We can make PHP5 work in Lighttpd through FastCGI. Therefore we install the packages lighttpd-fastcgi and php-cli:
yum install lighttpd-fastcgi php-cli
To enable PHP5 in Lighttpd, we must modify two files, /etc/php.ini and /etc/lighttpd/lighttpd.conf. First we open /etc/php.ini and add the line cgi.fix_pathinfo = 1 right at the end of the file.
Then we open /etc/lighttpd/lighttpd.conf and uncomment “mod_fastcgiâ€, in the server.modules stanza.