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)
Using set_time_limit(0) is useless when using php-fpm or similar process manager.
Bottomline is not to use set_time_limit when using php-fpm, to increase your execution timeout, check this tutorial.
set_time_limit
php-fpm