Try run php --ini to confirm the loaded ini file is the one being edited.
Increasing max execution time in production not working
My project needs more than 60 seconds to query thousands of data. I placed ini_set('max_execution_time', 180); just after the namescape on my main controller. It somehow increased the execution time to 3 minutes but it only works in development stage. In production stage, it limits execution time to 60 seconds even though I've placed the code.
I've tried changing the max_execution_time to 180 in php.ini, then restarted php7.2-fpm, nginx, recaching the config of the project but still didn't work.
Is this a laravel thing? or a PHP thing? Because I've already tried changing both php.ini in both cli and fpm folder and restarted php7.2-fpm and nginx service, but it still doesn't work.
Update: Turned out it also didn't work in local server on nginx, which would probably mean it's nginx that's causing this problem. Any ideas as to why? Here's what my server config looks like
server {
listen 80;
server_name example.com;
#root /var/www/Project_KamotV2/public;
root /home/steven-sama/Project_KamotV2/public;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
index index.html index.htm index.php;
charset utf-8;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
error_page 404 /index.php;
location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.(?!well-known).* {
deny all;
}
}
I copied this from laravel official site in deployment section in the documentation.
echo phpinfo(); can you see the right execution time ? If so then the problem is not from the ini file. Since your dev is working correctly, there must be a setting in your production that is causing this.
Go through all possible timeout settings in nginx ( look it up) . Google your specific setup ( OS,caching anything else running) and timeout problems. There must be some setting wrong if it is not php.
Good luck!
Please or to participate in this conversation.