Skip to content

Installation from source

Nicolas edited this page Jan 10, 2019 · 4 revisions

Installation

Clone this repository:

$ git clone git@github.com:nikrou/phyxo.git

Install composer following instruction on composer documentation. I supposed you have installed composer globally or in your path.

Go in the directory created (phyxo) and retrieve dependencies:

$ composer install

Create mandatory directories:

$ mkdir var upload plugins _data

And give appropriate permissions to var, upload, plugins, themes, language, for the user (apache, www-data, ...) who will serve pages:

$ sudo setfacl -R -m u:www-data:rwx -m u:`whoami`:rwx var upload plugins themes language _data local
$ sudo setfacl -dR -m u:www-data:rwx -m u:`whoami`:rwx var upload plugins themes language _data local

If do not have setfacl command, with debian you just install it with:

# apt install acl

You must compile admin assets (css and javascript files):

$ cd admin/theme
$ npm ci
$ npm run build

Finish installation in your favorite browser:

With php build-in web server:

Copy the content of router.php locally and run:

$ php -S localhost:8000 -t . router.php

Open your browser following http://localhost:8000

With symfony web-server-bundle:

Install web-server bundle:

$ composer require symfony/web-server-bundle

And now you can simply run:

$ ./bin/console server:run --docroot=.

Open your browser following http://localhost:8000

Using nginx and php-fpm

The nginx configuration to run the application can be:

server {
    listen 80 default_server;
    listen [::]:80 default_server;

    root /path/to/phyxo;
    index index.php index.html;

    location / {
        # try to serve file directly, fallback to index.php
        try_files $uri /index.php$is_args$args;
    }

    ## Add following location only for phyxo lower than 1.9.x and lower
    location ~ ^/(ws|i)\.php {
        fastcgi_pass unix:/run/php/php7.2-fpm.sock;
        fastcgi_split_path_info ^(.+\.php)(/.*)$;

        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param APP_ENV dev;

        include fastcgi_params;
    }

    location ~ ^/index\.php {
        fastcgi_pass unix:/run/php/php7.2-fpm.sock;
        fastcgi_split_path_info ^(.+\.php)(/.*)$;

        fastcgi_param APP_ENV dev;
        include fastcgi_params;

        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        fastcgi_param DOCUMENT_ROOT $realpath_root;
    }
}

That configuration is based on symfony ones The special location "location ~ ^/(ws|i).php" is needed because thoses urls are not managed by symofny router.

Open your browser following http://localhost

Using apache 2.4 and php-fpm

The apache configuration to run the application can be:

Alias /phyxo	/path/to/phyxo
<Location /phyxo>
   Require all granted
   Options -MultiViews

   RewriteEngine On
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteRule ^(.*)$ index.php [QSA,L]
</Location>

Open your browser following http://localhost/phyxo/

or with a virtual host:

<VirtualHost *:80>
   DocumentRoot /path/to/phyxo
   <Location />
      Require all granted
      Options -MultiViews

      RewriteEngine On
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteRule ^(.*)$ index.php [QSA,L]
   </Location>
</VirtualHost>

Open your browser following http://localhost