FreeBSD Lighttpd fastcgi php configuration

Posted: December 5, 2009 in Freebsd

Assume you have install freebsd and php5.

than let configure php5 to run with lighttpd

[root@bsd ~]# /usr/local/etc/lighttpd.conf

Make sure FASTCGI module is enabled:

server.modules += ( “mod_fastcgi” )

uncommend ths 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:

[root@bsd ~]# /usr/local/etc/rc.d/lighttpd restart

test server using this foolowing code

[root@bsd ~]# pico phpinfo.php

<?php
phpinfo();
?>

Save and close the file.

open your browser

http://localhost/phpinfo.php

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s