7

I followed this guide and updated the values:

/etc/php/7.0/fpm/php.ini and change/add this:

max_execution_time = 300

and /etc/php/7.0/fpm/pool.d/www.conf as well and change/add this:

php_admin_value[max_execution_time] = 300

and /etc/nginx/sites-available/example.com, and in the cgi section add:

fastcgi_read_timeout 300;

... followed by restarts but still:

# php -i | grep max_execution_time
max_execution_time => 0 => 0

This is the location block for my site:

location ~ .php$ {
    fastcgi_split_path_info ^(.+.php)(/.*)$;
    try_files $uri =404;
    fastcgi_keep_conn on;
    fastcgi_read_timeout 600;
    include /etc/nginx/fastcgi_params;
    fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}

What am doing wrong?

Nimbuz
  • 149
  • 1
  • 1
  • 8

1 Answers1

8

When you run php -i from command line, it will use configuration settings for your PHP CLI client, which are likely located in /etc/php/7.0/cli/php.ini.

If you want to check settings for your PHP-FPM, create a script with following contents in your web root:

<?php phpinfo(); ?>

And then go to the script URL in your browser.

Another alternative that might work is to run php -b 127.0.0.1:9000 -i, which will make the PHP CLI connect to your FastCGI server to execute the command. You might need to change the address depending on your configuration.

Tero Kilkanen
  • 36,796
  • 3
  • 41
  • 63
  • As a side note... This answer uses debian/ubuntu-ish paths to reflect the question (i believe). Yours may likely be different. Also, php --ini | grep -P 'php.ini$' will let you find the main php ini file used. For php-fpm, look for /etc/php* and you should find relevant files with ease. Port 9000 will not work for fastcgi server listening on a socket. – OldFart Dec 07 '22 at 09:11