FreeBSD Lighttpd fastcgi php configuration and installation
Q. How do I install and configure php under Lighttpd web server. I'm using
=> FreeBSD 6.2
=> Lighttpd 1.5
=> FastCGI PHP 5.2
How do I configure php under Lighttpd?
A. PHP generally runs on a web server like lighttpd taking PHP code as its input and creating Web pages as output. FastCGI is a protocol for interfacing interactive programs with a web server. Lighttpd has mod_fastcgi to run php application.
Assuming that you have php installed (see these instructions on installing Lighttpd+MySQL+php5 under FreeBSD), open lighttpd.conf file:
# vi /usr/local/etc/lighttpd.conf
Make sure FASTCGI module is enabled:
server.modules += ( "mod_fastcgi" )
Now append following code
fastcgi.server = ( ".php" =>
( "localhost" =>
(
"socket" => "/tmp/php-fastcgi.socket",
"bin-path" => "/usr/local/bin/php-cgi"
)
)
)
Save and close the file. Restart lighttpd:
# /usr/local/etc/rc.d/lighttpd restart
Subscribe to our free e-mail newsletter or RSS feed to get all updates.
You can Email this page to a friend.
Related Linux / UNIX FAQ:
- Lighttpd virtualhost configuration ~ name-based virtual hosting
- Debian / Ubuntu Linux search package names with apt-cache command
- Lighttpd as you compiled without pcre support error and solution
- Fedora Core Linux chkconfig does not display service name
- FreeBSD Configure Apache 2.2 PHP with FastCGI mod_fcgi Module
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Please do not use the comment form to ask for help / question. Ask your question on the excellent Linux tech support forum. Thank you very much for stopping by our site!
Tags: fastcgi, FreeBSD, php_5, protocol, web_server ~ Last updated on: June 30, 2007


Recent Comments
Today ~ 17 Comments
Today ~ 2 Comments
Today ~ 37 Comments
Today ~ 46 Comments
Yesterday ~ 2 Comments