Recently, I’ve been having issues with php-cgi.exe crashing on Apache 2.2 and IIS7 on Windows 2008. So, I’ve been searching for alternative ways of running my PHP application.
Let’s try LightTPD 1.4.28 and PHP 5.3.5.
Get the Windows binaries for LightTPD from WLMP project: http://en.wlmp-project.net/downloads.php. I chose the ZIP package with SSL support.
Get the Windows binaries for PHP from: http://windows.php.net/download/. I chose the ZIP package VC9 x86 Non-Thread-Safe.
Uncompress them into drive C: so that we can have C:\LightTPD and C:\PHP .
Go to C:\LightTPD\conf\
Edit lighttpd-srv.conf. Change file relative paths to absolute paths to read:
server.errorlog = "c:/lighttpd/logs/lighttpd-srv.error.log" accesslog.filename = "c:/lighttpd/logs/lighttpd-srv.access.log" server.pid-file = "c:/lighttpd/logs/lighttpd-srv.pid" include "c:/lighttpd/conf/lighttpd-tag.conf" include "c:/lighttpd/conf/lighttpd-inc.conf"
Enable mod_fastcgi among server.modules and check following settings:
server.document-root = "C:/LightTPD/htdocs/" server.upload-dirs = "C:/LightTPD/tmp/" fastcgi.server = ( ".php" => ("localhost" => ("host" => "127.0.0.1", "port" => 521 ) ) )
Go to C:\LightTPD\htdocs
Create phpinfo.php with content:
Go to C:\PHP.
Have a copy of php.ini-production as php.ini.
Run PHP CGI:
C:\PHP>php-cgi.exe -b 127.0.0.1:521
C:\LightTPD>LightTPD.exe -f conf\lighttpd-srv.conf -m lib