How can I find out where max_execution_time is being set to 60?

October 20, 2017 1.2k views
PHP Apache WordPress Ubuntu 16.04


Running php7, apache2 on ubuntu 16.04

I am having some issues regarding XML parsing in Wordpress.

My max_execution_time needs to be changed to 180 serverwide, but I cannot seem to change it. I have tried altering php.ini in /etc/php/7.0/apache2/, which my phpinfo() says is the relevant file. I have restarted my Apache2 server, but it doesn't seem to change anything. max_execution_time stays at 60.

phpinfo() says that there are also other ini files being loaded, and my guess is that one of these files may handle the max_execution_time setting. I cannot figure out if this is the case, or if so - how to find and change the setting. Can anyone help me out?

1 Answer

In general, /etc/php/7.0/apache2/php.ini is the file where max_execution_time is configured. After making an update there, you will need to restart Apache with: sudo service apache2 restart

In your case, it sounds like this value is being over-rode in a different file (possibly located in /etc/php/7.0/apache2/conf.d/). The first thing I would try to locate where this is occurring is search the files in /etc with grep For example:

  • grep -r 'max_execution_time' /etc/

One thing that is important to note is that the command line php command uses a separate configuration file from the one used by Apache. This is generally located at /etc/php/7.0/cli/php.ini but you can find it on your system by running:

  • php -i |grep "php.ini"
Have another answer? Share your knowledge.