Skip to content

Instantly share code, notes, and snippets.

@kakra
Created July 15, 2011 16:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kakra/1085054 to your computer and use it in GitHub Desktop.
Save kakra/1085054 to your computer and use it in GitHub Desktop.
PHP Stand-Alone Server based on LigHTTPd
#!/bin/bash
TMPNAME=$(mktemp /tmp/lighttpd-fastcgi-php-XXXXXX)
cat >$TMPNAME.conf <<-EOF
server.bind = "localhost"
server.port = "3000"
server.document-root = "$(pwd)"
server.indexfiles = ("index.php", "index.html", "index.htm", "default.htm")
server.modules += ("mod_cgi", "mod_accesslog")
include "/etc/lighttpd/mime-types.conf"
cgi.assign = (".php" => "/usr/bin/php-cgi")
server.follow-symlink = "enable"
EOF
/usr/sbin/lighttpd -D -f $TMPNAME.conf
rm -f $TMPNAME.*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment