Hi everyone, I am hoping that someone on here can help me sovle this before I'm forced to move back to Apache where I know this just works.
I have a PHP script which can take a 3 minutes to execute and which runs fine from the command-line using php. however, when I trigger the script from a web page, I receive a HTTP 499 response within the nginx access logs 60 seconds after the request is made.
Reading around online I've made the following NginX config changes to try to force the server to run for more than 60 seconds:
- Within the location directive
fastcgi_send_timeout 1200;
fastcgi_read_timeout 1200;
fastcgi_connect_timeout 1200
- Within the server directive
client_header_timeout 1200;
client_body_timeout 1200;
keepalive_timeout 600;
On the PHP side, I've set the php-fpm config setting to include:
request_terminate_timeout = 1200s
request_terminate_timeout = 0
On the main PHP.ini side I've set:
max_execution_time = 1200
default_socket_timeout = 1200
mysql.connect_timeout = 1200
When I run a phpinfo() on the webserver I can see all of these PHP config settings have been picked up and yet still when I run the script I receive the HTTP/1.1 499 response after only 60 seconds.
The script has been successfully run against:
1. The PHP cli
2. The PHP-CGI cli
3. Apache 2.4.2
I'm running NginX 1.1.19 and PHP 5.4.11
I've exhausted everything I can think off, and all of my searches online turn up either unanswered questions or point to increasing the fast_cgi settings within the Nginx which I have done witihn the sites-enabled/ config.
Sadly if I can't find a solution soon, I will have to ditch NginX for this project, so any help would be greatly appreciated