The PHP platform is built to be able to manage multiple front-end and interpretors. You can manage them in your tsuru.yml
configuration file.
php:
version: 5.6
frontend:
name: nginx
interpretor:
name: fpm
composer: true
Currently, php supported versions are:
- 5.6
- 7.0
- 7.1
- 7.2
- 8.0
- 8.1
- 8.2
- 8.3
The following frontends are currently supported:
apache
: Apachenginx
: Nginx
You can chose between them by setting the php.frontend.name
parameter:
php:
frontend:
name: apache
Each frontend supports options that can be set in the php.frontend.options
parameters.
All these options are not required, and can be used the following way:
php:
frontend:
name: apache
options:
vhost_file: /path/to/vhost.conf
modules:
- rewrite
vhost_file
: The relative path of your Apache virtual host configuration filemodules
: An array of module names, such asrewrite
for instance
vhost_file
: The relative path of your Nginx virtual host configuration file
The following PHP interpretors are supported:
fpm
: PHP-FPM
You can chose between them by setting the php.interpretor.name
parameter:
php:
interpretor:
name: fpm
These interpretors can also have options configured in the php.interpretor.options
parameter.
If you choose fpm
interpretor, use extensions
option to install php extensions instead of using requirements.apt
All these options are not required and can be used the following ways
php:
interpretor:
name: fpm54
options:
ini_file: /path/to/file.ini
extensions:
- php-mysql
ini_file
: The relative path of yourphp.ini
file in your project, that will replace the default oneextensions
: A list of php extensions you need
In addition to the frontend
and interpretor
options, there's an other one:
composer
: A boolean that is by default to true. If the value is true, it'll run acomposer install
if there's acomposer.json
file at the root of your application.
To keep the backward compatibility, there's also a apache-mod-php
frontend that is in fact the Apache with modphp enabled, that remove the need of an interpretor.
That's currently the default configuration if no parameter is set along php version 5.6.
With the current implementation, it's quite easy to add another interpretor for instance.