Jun 9, 2010

Lighttpd PHP fastcgi configuration

Install lighttpd

# yum install lighttpd
# yum install lighttpd-fastcgi


Make sure php support fastcgi

$ php-cgi -v

PHP 5.0.4 (cgi-fcgi) (built: Nov 8 2005 08:25:54)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.0.4-dev, Copyright (c) 1998-2004 Zend Technologies


Open lighttpd configuration file:

# vi /etc/lighttpd/lighttpd.conf

server.modules = (
"mod_access",
"mod_accesslog",
"mod_fastcgi",
"mod_rewrite",
"mod_auth"
)


Add the following lines:

fastcgi.server = ( ".php" => ((
"bin-path" => "/usr/bin/php-cgi",
"socket" => "/tmp/php.socket"
)))


Restart the lighttpd server

# /etc/init.d/lighttpd restart

No comments: