Managed Service PHP
Managed Service PHP
The PHP versions available depend on the Ubuntu version in use.
We have summarized an overview of the available PHP versions in this support article.
PHP versions can be set individually per Virtual Host (when using PHP-FPM).
PHP-FPM
FPM stands for "FastCGI Process Manager". With this integration, the PHP code is interpreted by pre-started PHP processes. Apache passes the requests to the FastCGI Process Manager and does not interpret the code itself.
A big advantage of the FPM integration is the increased security when using multiple environments on one server. Each environment is isolated and runs under its own user ID.
In addition, thanks to process separation, different PHP versions can be used for different vhosts at the same time.
Select the PHP version with nine-manage-vhosts
If PHP-FPM is installed, the desired version can be selected for each virtual host.
Create virtual host with PHP 8.0:
www-data@nine01:~ $ sudo nine-manage-vhosts virtual-host create example.org \
--template-variable=PHP_VERSION=8.0
Change to PHP 8.1 for above example:
www-data@nine01:~ $ sudo nine-manage-vhosts virtual-host update example.org \
--template-variable=PHP_VERSION=8.1
Empty the PHP OPcache
To speed up the loading and parsing of scripts, the PHP OPcache is enabled by default. This reduces the execution time of PHP scripts by storing precompiled bytecode in memory.
You can flush this cache, for example after deployments, by calling our tool nine-flush-fpm
; no admin rights are required for this.
nine-flush-fpm
flushes the cache for all PHP-FPM environments of all users.
You can also flush the cache for a specific PHP environment of a user. For this purpose we provide the tool nine-php-cachetool
:
Query status for PHP 8.1:
www-data@nine01:~ $ nine-php-cachetool -v 8.1 status
Clear cache for PHP 8.1:
www-data@nine01:~ $ nine-php-cachetool -v 8.1 reset
Customize PHP CLI version
Note: This feature is available on Ubuntu 20.04 Focal and newer. Please contact our support for an update via support request in Cockpit or by email to .
The available PHP CLI versions can be displayed with the following command:
www-data@nine01:~ $ sudo nine-manage-vhosts php-cli list
php7.4
php8.0
php8.1
The available PHP versions can be run directly.
www-data@nine01:~ $ php8.0 --version
The currently active version can be displayed as follows:
www-data@nine01:~ $ sudo nine-manage-vhosts php-cli show
php8.0
The default version can be customized as follows:
www-data@nine01:~ $ sudo nine-manage-vhosts php-cli update php8.1
PHP version successfully updated to php8.1