Installing Magento on Lighttpd 1.4.X via FastCGI

Last modified by PremierWeb on Thu, June 24, 2010 15:21
Source|Old Revisions  

This is an old revision of the document!


If you are familiar with Lighttpd, it does not support .htaccess, thus the out of the box magento installation won’t work. Never fear, however, for a few simple server configuration change makes it all better.

  1. $HTTP["host"] =~ "^(www.)?example.com$" {
  2.         server.name     = "www.example.com"
  3.         server.document-root  = "/var/www/example.com/magento/"
  4.         server.error-handler-404 = "/index.php"
  5. }

Essentially, this forwards all non-existent urls in index.php for routing. Simple.

Next, install the htscanner PHP module and add it to your php.ini to properly override the PHP configuration parameters (memory_limit, max_execution_time, etc.) specified in Magento’s .htaccess files.

Since Lighttpd does not properly parse the query string, add the following to the top of index.php to get the list/grid view and admin areas working.

  1. if(empty($_GET) && FALSE !== strpos($_SERVER['REQUEST_URI'], '?'))
  2. {
  3.     $tmp = parse_url($_SERVER['REQUEST_URI']);
  4.     $_SERVER['QUERY_STRING'] = $tmp['query'];
  5.         unset($tmp);
  6.     parse_str($_SERVER['QUERY_STRING'], $_GET);
  7. }



 

Magento 2 GitHub Repository

Magento Job Board - Some sort of tag line goes here

Latest Posts| View all Jobs