How to Modify the PHP Configuration File on Ubuntu


The php.ini file is a default configuration file that read on PHP starts up. The PHP settings and configuration can be modified by the php.ini file.

If you want to change the PHP settings on Ubuntu, php.ini file is an easy and most effective way to do it. Follow the below steps to modify the PHP configuration file (php.ini) using the command line on Ubuntu.

  • Open the terminal and run the following command to open the php.ini file.
    sudo nano /etc/php5/apache2/php.ini
  • Change the PHP settings. For example, if you want to increase the execution time, increase the max_execution_time variable value in seconds.
    max_execution_time = 90
  • Once you modified the PHP configuration values as per your needs, save changes and exit editor.
  • Now restart the web server to enable the changes you have done.
    sudo service apache2 restart

1 Comment

  1. Saquib Rizwan Said...

Leave a reply