devilbox/docs/configuration-files/php-ini.rst
2018-04-14 10:17:43 +02:00

3.0 KiB

php.ini

php.ini changes are global to all projects, but will only affect the currently selected PHP version.

Table of Contents

local

General

You can set custom php.ini configuration options for each PHP version separately. See the directory structure for PHP configuration directories inside ./cfg/ directory:

host> ls -l path/to/devilbox/cfg/ | grep 'php'

drwxr-xr-x  2 cytopia cytopia 4096 Mar  5 21:53 php-fpm-5.4/
drwxr-xr-x  2 cytopia cytopia 4096 Mar  5 21:53 php-fpm-5.5/
drwxr-xr-x  2 cytopia cytopia 4096 Apr  3 22:04 php-fpm-5.6/
drwxr-xr-x  2 cytopia cytopia 4096 Mar  5 21:53 php-fpm-7.0/
drwxr-xr-x  2 cytopia cytopia 4096 Mar  5 21:53 php-fpm-7.1/
drwxr-xr-x  2 cytopia cytopia 4096 Mar  5 21:53 php-fpm-7.2/

Customization is achieved by placing a file into cfg/php-fpm-X.X/ (where X.X stands for your PHP version). The file must end by .ini in order to be sourced by the PHP-FPM server.

Each of the PHP ini configuration directories already contain an example file: devilbox-custom.ini-example, that can simply be renamed to devilbox-custom.ini. This file holds some example values that can be adjusted or commented out.

In order for the changes to be applied, you will have to restart the Devilbox.

Examples

Change memory_limit for PHP 7.1

The following examples shows you how to change the memory_limit of PHP 7.1 to 4096 MB.

# Navigate to the Devilbox directory
host> cd path/to/devilbox

# Navigate to PHP 7.1 config directory
host> cd cfg/php-fpm-7.1

# Create new ini file
host> touch memory_limit.ini

Now add the following content to the file:

[PHP]
memory_limit = 4096M

In order to apply the changes you need to restart the Devilbox. You can validate that the changes have taken place by visiting the Devilbox intranet phpinfo page.

Change timeout values for PHP 5.6

The following examples shows you how to change the max_execution_time and max_input_time of PHP 5.6.

# Navigate to the Devilbox directory
host> cd path/to/devilbox

# Navigate to PHP 5.6 config directory
host> cd cfg/php-fpm-5.6

# Create new ini file
host> touch timeouts.ini

Now add the following content to the file:

[PHP]
max_execution_time = 180
max_input_time     = 180

In order to apply the changes you need to restart the Devilbox. You can validate that the changes have taken place by visiting the Devilbox intranet phpinfo page.