The One with the Thoughts of Frans

Lighttpd and PHP on Ubuntu

I prefer Lighttpd over Apache on my personal computers because of its phenomenal speed and reduced memory usage. It’s surprisingly easy to get Lighttpd and PHP running on Ubuntu. For an extensive guide, including how to enable MySQL, Ubuntu Geek is the place to be.

This entry only deals with the basics of getting Lighttpd up and running with PHP. To get started, use:

sudo apt-get install lighttpd php5-cgi

Then run lighty-enable-mod and enter fastcgi.

Then you can edit /etc/lighttpd/lighttpd.conf. Stick the following at the end:

fastcgi.server = ( “.php” => ((
“bin-path” => “/usr/bin/php5-cgi”,
“socket” => “/tmp/php.socket”

Recommended: sudo apt-get install php5-curl php5-tidy to be able to run Tubes with all functionality, and of course any other modules you might like. There’s nothing to it; you don’t even have to edit php.ini.

When you’re done customizing things to your liking, use sudo /etc/init.d/lighttpd restart to see the changes.

Leave a Comment

You must be logged in to post a comment.