How to configure PHP parameters (Debian/Ubuntu)

To configure the parameters, you need to make changes to the php.ini configuration file. The path to this file depends on how you use PHP on your server. To define it use Phpinfo.php script.

How to create Phpinfo script

1. Connect to the server via SSH

2. Go to the site directory:

cd /path_to_directory

3. In this directory, create a phpinfo.php file:

nano phpinfo.php

4. Add this content to phpinfo.php file:

<?php

phpinfo();

?>

5. Press Ctrl+x,

Then press Y and Enter to save your changes.

6. Enter in the browser address bar:

http://your.domain.name/phpinfo.php

Here you can see information about PHP settings.

The Loaded Configuration File line will display the path to the php.ini configuration file

For example:

Loaded Configuration File

/etc/php/7.2/apache2/php.ini

Setting parameters (for example mbstring.func_overload)

1. Find the required parameter in php.ini using the command:

grep -ni 'parameter_name' /path/to/file/php.ini

For example, if /etc/php/7.2/apache2/php.ini is the path to the configuration file, the parameter name is mbstring.func_overload, the command will look like this:

grep -ni 'mbstring.func_overload' /etc/php/7.2/apache2/php.ini

Using the -n switch, you can see which line the required directive is on.

2. Using the line number, you can open the file with a text editor with following command:

nano +line_number path/to/file/php.ini

For example, if /etc/php/7.2/apache2/php.ini is the path to the configuration file, line number is 1546, the command will look like this:

nano +1546 /etc/php/7.2/apache2/php.ini

3. Remove the ";" and set the desired parameter value (in this case 2):

BEFORE:  ;mbstring.func_overload = 0

AFTER:  mbstring.func_overload = 2

4. Press Ctrl + x,

Then press Y and Enter to save the changes.

5. Restart Apache

service apache2 restart

6. Refresh the page http: //your.domain.name/phpinfo.php in the browser and check the meaning of the directive.

7. To check, refresh the page http: //your.domain/phpinfo.php and find the current value of the required directive (in our case, mbstring.func_overload).

mbstring.func_overload 2 2

If you have any questions, please create a ticket to technical support.