I am getting 504 timeouts message from nginx when my PHP script is running longer than usual. set_time_limit(0)
does not seem to prevent that! Does it not work when running php5-fpm on nginx? If so, whats the proper way of setting the time limit?
Error:
504 Gateway Time-out
nginx/1.2.7
You can't use PHP to prevent a timeout issued by nginx.
To configure nginx to allow more time see the
proxy_read_timeout
directive.Try this link, it has a better solution on how to fix this. So the steps are:
nginx.conf
file located in/etc/nginx
directory.Add this below piece of code under
http {
section:Note: If its already present , change the values according.
Reload Nginx and php5-fpm.
If the error persists, consider increasing the values.
I solve this trouble with config APACHE ! All methods (in this topic) is incorrect for me... Then I try chanche apache config:
Timeout 3600
Then my script worked!