I'm trying to adjust max_execution_time and memory_limit directives.

phpinfo() output:

Server API  FPM/FastCGI Virtual Directory Support   disabled
Configuration File (php.ini) Path   /etc/php/7.0/fpm Loaded
Configuration File  /etc/php/7.0/fpm/php.ini 
Scan this dir for additional .ini files /etc/php/7.0/fpm/conf.d

I have updated both directives in


and restarted apache2 but no luck.

php -r 'print php_ini_loaded_file(); print_r(php_ini_scanned_files());' output:


php --ini ouput:

Configuration File (php.ini) Path: /etc/php/7.0/cli
Loaded Configuration File:         /etc/php/7.0/cli/php.ini
Scan for additional .ini files in: /etc/php/7.0/cli/conf.d
Additional .ini files parsed:      /etc/php/7.0/cli/conf.d/10-mysqlnd.ini,

I have updated both directives in


and restared apache2 but again no luck.

find / -type f -name "php.ini" ouput:


Again, I have updated both directives in all *.php.ini files and restarted apache2 but still phpinfo() displays old settings.

Any ideas what I'm doing wrong here?

  • Did you restart php (php-fpm) ? Mar 6, 2020 at 16:21
  • I forgot about it! Haha, thank you very much @Gerard H. Pille :) Please post this as answer and I will mark this as solved.
    – Kris
    Mar 6, 2020 at 16:26

2 Answers 2


Php-fpm runs independently from Apache, so it needs a reload or restart to see the new directives. ;-)


Based on the configuration layout this seems a Debian based system.

For each major.minor release M.N of PHP (where M is 7 and N is 0, 1, ...), each of the SAPI's (apache2/cgi/fpm/cli/phpdbg/...) have a different central configuration file /etc/php/M.N/$SAPI/php.ini

Based on the output of phpinfo() Apache is using the PHP FPM/FastCGI as the Server Application Programming Interface (SAPI). Therefore, the configuration files in /etc/php/7.0/fpm/ are used. Reloading the configuration requires reloading the PHP-FPM (separate from Apache):

sudo systemctl reload php7.0-fpm

When you use PHP from the command line, CLI SAPI is used, instead, so /etc/php/7.0/cli/ is in use. The PHP CLI reads the configuration when you launch the command. That's why the commands you used for testing gave conflicting results.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .