Adding PHP into Lighttpd Webserver

How do I configure php under Lighttpd?

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

4 Responses to “Adding PHP into Lighttpd Webserver”

  1. How to install Lighttpd, PHP5, and MySQL on FreeBSD | Glen Lumanau Blog says:

    October 9th, 2008 at 11:51 am

    [...] Click here for more information addthis_url = ‘http%3A%2F%2Fwww.lumanau.web.id%2F2008%2F10%2F09%2Fhow-to-install-lighttpd-php5-and-mysql-on-freebsd.html’; addthis_title = ‘How+to+install+Lighttpd%2C+PHP5%2C+and+MySQL+on+FreeBSD’; addthis_pub = ”; [...]

  2. holycow says:

    January 7th, 2009 at 6:46 am

    also might be worth mentioning to turn php_short_tag = On in the php.ini file if all you get is a blank php page (most stuff is written <? rather than <?php)

  3. glen says:

    January 8th, 2009 at 5:20 pm

    I think it might be described on onother post that’s talking about why PHP is not working

  4. glen says:

    January 8th, 2009 at 5:20 pm

    I think it might be described on onother post that’s talking about why PHP is not working

    anyway thx for your suggestions

Leave a Reply