Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Setting up on Nginx with PHP FPM on Linux

maxfierke edited this page Feb 6, 2013 · 2 revisions

Nginx is the preferred server on which OpenSkedge is developed and will always be supported. It requires a bit more steps to setup than OpenSkedge on a traditional LAMP stack, but it has many benefits.

Fetching dependencies

Using your distribution's package manager, install find and install the packages for nginx, php-fpm, php-cgi, mysql (or another database if you choose), php-mysql, the PDO mysql driver (if it's a separate package from the PHP MySQL package), php-pear. These will have a variety of different names in different distributions. Here's what it will look like in Debian or Ubuntu-based distributions: $ sudo apt-get install nginx php5-fpm php5-cgi mysql-server php5-mysql php-pear

Configuration

PHP Configuration (php.ini)

PHP-FPM Configuration (php-fpm.conf)

Nginx virtual host

  1. Create a new virtual host in /etc/nginx/sites-enabled (or wherever your installation of Nginx reads configuration files from)
  2. Use something similar to the following, replacing the placeholders in [] with your configuration
server {
        root    [/path/to/openskedge]/web;
        index   app.php;

        server_name [hostnames for your installation eg. example.com www.example.com];

        location / {
            try_files $uri $uri/ /app.php?$query_string;
        }

        location ~ ^/(app_dev|app)\.php$ {
            fastcgi_pass 127.0.0.1:9000;
            include fastcgi_params;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        }

        location ~ /\.ht {
            deny all;
        }
}
  1. Reload nginx (e.g. sudo service nginx reload)