<commit_before>.. _php_ini:

*******
php.ini
*******


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


**Table of Contents**

.. 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:

.. code-block:: bash

    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 same 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 <https://secure.php.net/manual/en/ini.core.php#ini.memory-limit>`_ of PHP 7.1 to
4096 MB.

.. code-block:: bash

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

    # Navigate to PHP 7.1 config directory<commit_msg>Documentation: typo fix<commit_after>.. _php_ini:

*******
php.ini
*******


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


**Table of Contents**

.. 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:

.. code-block:: bash

    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 <https://secure.php.net/manual/en/ini.core.php#ini.memory-limit>`_ of PHP 7.1 to
4096 MB.

.. code-block:: bash

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

    # Navigate to PHP 7.1 config directory
{'fraction_non_alphanumeric': 0.12647887323943663, 'fraction_numerical': 0.04619718309859155, 'mean_word_length': 3.0398179749715584, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1992332', 'n_tokens_mistral': 1342, 'n_tokens_neox': 1175, 'n_words': 457}