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
set_time_limit(0)
The correct answer is increasing fastcgi_read_timeout in your Nginx configuration.Simple as that!