Welcome! Log In Create A New Profile

Advanced

Re: 504 Timeout when running PHP script

Alexander Vogt
March 16, 2010 07:56AM
Hi,

> I have a PHP script that processes a folder of images,
> it takes quite a while to do this, but should produce
> output as it goes along. But when running this script I
> get a 504 Timeout, probably after 60s. The script also
> appears to stop running, so I end up with some database
> records written, and others not. (Does nginx send a
> signal to the fastcgi process to tell it to stop what
> it's doing and get on with the next request?)

I see you already set fastcgi_read_timeout to a high value on your server,
so the problem may lie on the PHP side.

Check your max_execution_time (have a look at the memory limits aswell) in
php.ini to make sure PHP itself does not trigger a timeout. You should also
make sure that your script does not use output buffering (and also disable
output buffering in php.ini), and it flushes its output immediately (check
out the implicit_flush directive on php.ini).

greetings,
alex

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

504 Timeout when running PHP script

djeyewater March 16, 2010 06:08AM

Re: 504 Timeout when running PHP script

Alexander Vogt March 16, 2010 07:56AM

Re: 504 Timeout when running PHP script

djeyewater March 17, 2010 07:57AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 135
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready