Step 5: Install Lighttpd & PHP

Lighttpd is a lightweight web server, with all the essential functions of a web server

sudo apt-get update #download package lists from the repositories

sudo apt-get -y install lighttpd .

Install PHP

PHP is a server-side scripting language designed for web development but also used as a general-purpose programming language.

sudo apt-get -y install php5-common php5-cgi php5

sudo lighty-enable-mod fastcgi-php #Enable the Fastcgi module which will handle the PHP pages

sudo service lighttpd force-reload #restart the Lighttpd service


The /var/www is the root directory of the website, it is currently owned by the “root” user. We must ensure the "Pi" user account can write files to /var/www directory.

sudo chown www-data:www-data /var/www

sudo chmod 775 /var/www #permission to write to this directory

sudo usermod -a -G www-data pi #add the “Pi” user to the “www-data” group

Reboot the Raspberry Pi, your Raspberry Pi web server is ready.

<p>Worked great. Saved me hours of searching around for bits &amp; pieces needed to install. THANKS!</p>
<p>Easy as Pi!</p>
<p>Worked fine! Great instructable</p>
<p>Very nice write up.. simple and easy to follow. </p>
<p>very detailed and useful instruction.</p>

About This Instructable




Bio: A place for DIY projects
More by smching:How to create webpages & setup website using Joomla CMS Learning, Experience and Review the Makeblock 3 in 1 MBot Ranger Robot Kit Arduino Based LCD Digital Clock 
Add instructable to: