PHP is a server-side scripting language designed primarily for web development but also used as a general-purpose programming language.
Each release branch of PHP is fully supported for two years beginning with its initial stable release. We provide different point releases and apply security updates on a regular basis. Currently, these PHP versions are available: 7.1, 7.2, 7.3 and 7.4.
If you don’t select a certain version, our default will be used. We decided to default to version 7.1, which is considered to be stable by the developers.
Show available versions¶
uberspace tools version list php to show all selectable versions:
[eliza@dolittle ~]$ uberspace tools version list php - 7.1 - 7.2 - 7.3 - 7.4 [eliza@dolittle ~]$
You can select the PHP version with
uberspace tools version use php <version>. You can choose between release branches:
[eliza@dolittle ~]$ uberspace tools version use php 7.4 Selected PHP version 7.4 The new configuration is adapted immediately. Patch updates will be applied automatically. [eliza@dolittle ~]$
[eliza@dolittle ~]$ uberspace tools version use php 7.2 Selected PHP version 7.2 The new configuration is adapted immediately. Patch updates will be applied automatically. [eliza@dolittle ~]$
You can check the selected version by executing
uberspace tools version show php on the command line:
[eliza@dolittle ~]$ uberspace tools version show php Using 'PHP' version: '7.1' [eliza@dolittle ~]$
Connection to webserver¶
pm = ondemand pm.max_children = 10 pm.process_idle_timeout = 900s; ; The number of requests each child process should execute before respawning. pm.max_requests = 500
We use a standard
php.ini configuration with minimal modifications to fit the needs of popular software:
realpath_cache_ttl = 300 max_execution_time = 600 max_input_time = 600 max_input_vars = 1500 memory_limit = 256M date.timezone = Europe/Berlin
We also set the timezone so error logs have the correct times.
There are two configuration directories for
php.ini files in your uberspace account:
~/etc/php.early.d. In most cases, you will only need
~/etc/php.d, but some applications require their directives to be at the start of the configuration. Only in those cases will you need
This is the default directory for
php.ini files. Any files inside this directory will be loaded additonally to the existing, global configuration and will overwrite the default values.
If your application requires its directives to be loaded before the rest of the configuration, create the
~/etc/php.early.d directory. Then put these directives into a
.ini file and place it there.
You need to reload PHP whenever you change your configuration files:
uberspace tools restart php checks your configuration for sanity and restarts your PHP instance.
You can adjust configuration directives for all modes:
PHP_INI_ALL. Put as many directives as you want into these files.
In the configuration we set
Europe/Berlin. Let’s say you want to set the timezone directive to
UTC: Create a file
~/etc/php.d/timezone.ini with your new settings and reload your configuration.
When there is an error in your configuration,
uberspace tools restart php tells you what to do. In this case we won’t reload your configuration to make sure the invalid configuration does not break your PHP setup.
In this case fix the value and run
uberspace tools restart php again.
[eliza@dolittle ~]$ php -i | grep date.timezone date.timezone => Europe/Berlin => Europe/Berlin [eliza@dolittle ~]$ echo "date.timezone = UTC" > ~/etc/php.d/timezone.ini [eliza@dolittle ~]$ uberspace tools restart php Your php configuration has been loaded. [eliza@dolittle ~]$ php -i | grep date.timezone date.timezone => UTC => UTC
[eliza@dolittle ~]$ cat ~/etc/php.d/timezone.ini date.timezone = idontexist [eliza@dolittle ~]$ uberspace tools restart php Your php configuration is invalid an cannot be loaded. Please examine the following output. PHP Warning: Unknown: Invalid date.timezone value 'idontexist', we selected the timezone 'UTC' for now. in Unknown on line 0
We provide the following modules:
Every host comes with a preinstalled version of Composer. This tool enables dependency management in PHP. It allows you to declare the libraries your project depends on and it will manage (install/update/remove) them for you.
Composer may use several sources to look for packages. These sources are called repositories. The default repository is Packagist.
Refer to the Composer Basic Usage guide for further information. Almost all common PHP projects support Composer nowdays and provide an example installation command.
We only provide a single version of composer and update it on a regular basis.