Want to try something else than IIS, Apache on a Windows platform?  Lighttpd may be worth a look 🙂

I actually stumbled across lighttpd when I was installing applications on my jailbroken Ipod touch, and it looked interesting…

I found a blogpost with getting started instructions;

I did not quite get PHP working just yet nor did I find out how to start the http server as a service, but there are tricks to running an app as a service so this should not be a showstopper.

How secure is it?  Well take a look here for advisories; http://secunia.com/advisories/search/?search=lighttpd

And now with no further delay here is the getting started guide (taken from the blog previously mentioned) with my comments;

1. Download and Install PHP

Download PHP from PHP website. I chose the zip package and simply unzipped it into my directory of choice: Almighty C drive! So now, it’s residing at “C:\php”. MIKE; You NEED to use the Zip package under Windows versions (the msi installer won’t work)

2. Download and Install LightTPD

Download a Win32 version of LightTPD from the WLMP Project; I chose the Setup Wizard (.exe) version.

Double-click on the downloaded executable to start the short installation process, during which you would specify the destination of the install. I installed mine at “C:\Program Files\LightTPD”.

3. Start and Test LightTPD

To start LightTPD, go to the LightTPD directory (i.e. “C:\Program Files\LightTPD”), find the file “TestMode.bat” and double-click on it. A console window would open and indicate that the server has been started.

To test that LightTPD is working at this moment, point your browser to http://localhost. You should see a “LightTPD Test Page”.

That was easy right? Now we just need to edit some configurations to make PHP work with LightTPD.

4. Editing LightTPD Configurations

Edit the file lighttpd-inc.conf (i.e. “C:\Program Files\LightTPD\conf\lighttpd-inc.conf”) with the following:

  • Remove the comment tag for “mod-cgi” (Line 20)
  • Add this line (assuming that PHP was installed on C drive):
    • cgi.assign = ( “.php” => “C:/php/php-cgi.exe” )

MIKE; Download Notepad ++to edit the file, it is in one of those damn linux formats so notepad will mess it up.

5. Editing PHP Configurations

In your PHP directory, rename the file php.ini-recommended to php.ini and edit php.ini with the following:

  • short_open_tag = On
  • display_errors = On
  • doc_root = “C:\Progra~1\LightTPD\htdocs”

6. Test PHP with LightTPD

To test that LightTPD now works with PHP, create a file with the following contents:

<?php phpinfo(); ?>

Place the file in your htdocs directory (i.e. “C:\Program Files\LightTPD\htdocs”), open up your browser and browse to the page. Walaa! You should be able to see the standard phpinfo() messages.

There you have it! A development environment for PHP on Windows in 6 simple steps. Now, to get started on the new template..

MIKE;good luck with your new webserver 🙂