How do I change the php.ini file on my VPS server?

Procédure

What is the purpose of the Php.ini file?

The php.ini file is a text file used to configure a whole range of PHP language parameters: compilation options, extensions, versions, server information, PHP environment, system information, paths, general and local configuration values, HTTP headers and the PHP licence.

The php.ini file can be used, for example, to view and modify :

max_input_vars memory_limit max_execution_time upload_max_filesize post_max_size


You can view all your PHP parameters by displaying a phpinfo in a web browser.

How do I modify the php.ini file on my VPS server via ISPConfig?

This help article is only for customers who have subscribed to a VPS package.

If you have subscribed to a shared web hosting package, please refer to the "How do I configure PHP?" documentation.

1. Connect to your ISPConfig panel

2. Go to the Sites tab (1) and click on your domain (2)

How do I change the php.ini file on my VPS server?

3) In the Options tab, enter the PHP parameter you want (in this case memory_limit) in the "Custom php.ini parameters" box:

memory_limit=32M


then click on the "Save" button

How do I change the php.ini file on my VPS server?

4) To check that the parameter has been accepted, at the root of your site via an FTP client such as Filezilla, create the file php_info.php containing the following code:

 phpinfo(); ?>


Then go to this address: http://mon_site/php_info.php

You can view the value given to each PHP parameter:

How do I change the php.ini file on my VPS server?


How do I modify the php.ini file on my VPS server via SSH?

1) Connect to your dedicated VPS server using SSH

2) Edit your php.ini file using the following command :

If you are using mod_php and therefore php.5.4 :

nano /etc/php5/apache2/php.ini


If you are using fast-CGI and php 5.3 :

nano /opt/phpfcgi-5.3.22/lib/php.ini


If you are using php-fpm :

with version php 5.3

 nano /opt/php-5.3.22/lib/php.ini


with php 5.4 :

 nano /opt/php-5.4.41/lib/php.ini 


with version php 5.5 :

 nano /opt/php-5.5.7/lib/php.ini 


with version php 5.6 :

 nano /opt/php5/fpm/php.ini 


with version php 7.0.15 :

 nano /opt/php-7.0.15/lib/php.ini 


with version php 7.1.1 :

 nano /opt/php-7.1.1/lib/php.ini 


For problems related to the SUHOSIN patch, the file is as follows:

nano /etc/php5/conf.d/suhosin.ini


Example of SUHOSIN errors:

Warning, your hosting provider is using the suhosin patch for PHP, which limit the maximum number of fields to post in a form: 1000 for suhosin.post.max_vars. 1000 for suhosin.request.max_vars. Please ask your hosting provider to increase the suhosin post and request limit to 4252 at least. or edit the translation file manually.


3) Modify the file as required and save it.

ctrl+x


4) Restart the Apache web server to take account of the changes made.

/etc/init.d/apache2 restart /etc/init.d/php5-fpm restart (for those using php-fpm and version 5.6) /etc/init.d/php-5.3.22 restart (for those using php-fpm and version 5.3) /etc/init.d/php-5.4.41 restart (for those using php-fpm and version 5.4) /etc/init.d/php-5.5.7 restart (for those using php-fpm and version 5.5) /etc/init.d/php-7.0.1 restart (for those using php-fpm and version 7.0.1)


If the restart was successful, you will get the following message;

Restarting web server: apache2 ... waiting .


If you get a message with the keyword ERROR, you have a problem. The following file should tell you what the problem is:

tail -f /var/log/apache2/error.log

Video procedure


I want a technician to modify the php.ini file on my VPS server. How do I do this?

LWS offers managed services for people who don't want to connect directly via SSH (a handling error can happen very quickly).

There are two solutions: either you have subscribed to a support option: this intervention is included in your package --> simply open an incident ticket with the technical department to indicate which directive needs to be changed.

Or, you can set up a one-off facilities management service: a technician will call you back within the hour and carry out the work with you. The technician will take the time to answer your questions and explain the changes made.

Rate this article :

5/5 | 2 opinion

This article was useful to you ?

Article utileYes

Article non utileNo

Vous souhaitez nous laisser un commentaire concernant cet article ?

Si cela concerne une erreur dans la documentation ou un manque d'informations, n'hésitez pas à nous en faire part depuis le formulaire.

Pour toute question non liée à cette documentation ou problème technique sur l'un de vos services, contactez le support commercial ou le support technique

MerciMerci ! N'hésitez pas à poser des questions sur nos documentations si vous souhaitez plus d'informations et nous aider à les améliorer.


Vous avez noté 0 étoile(s)

Similar articles

3mn reading

How do I access ISPConfig on my dedicated VPS server?

0mn reading

How do I create a DNS server in ISPConfig on a dedicated VPS server?

0mn reading

How do I change the ISPConfig 3 panel password?

1mn reading

How can I secure access to my ISPconfig panel using an .htaccess file?


Ask the LWS team and its community a question