Schlagwort-Archive: php5

Installing&Setting up Lighttpd + PHP in 2 Minutes

I personally never thought it was that easy to install & set up an entire web server on Linux in such short amount of time:

  1. pacman -S lighttpd php-cgi
  2. Edit /etc/lighttpd/lighttpd.conf and add following two lines:
    server.modules = ("mod_fastcgi")
    fastcgi.server = ( ".php" => (( "bin-path" => "/usr/bin/php-cgi","socket" => "/tmp/php.sock" )))
  3. To start lighttpd, just execute lighttpd -f /etc/lighttpd/lighttpd.conf
    If you want it to be launched at boot time, just say systemctl enable lighttpd
  4. Your web files will be stored in /srv/http by default. If you want to edit them without root rights, just make them your own 🙂
  5. You might need to have index.php as your default „fallback“ file – just head to the config and add „index.php“ to the index-file.names entry.
  6. Open your browser and type ‚localhost‘ to see if it works

Furthermore it’s strictly recommended to add some basic MIME type definitions like those for e.g. CSS-Stylesheets to the mimetype.assign field: ".js"=>"text/javascript", ".css"=>"text/css"