I have a function for a wordpress plugin I’m developing that takes a lot of time.
It connects to the TMDb (movies database) and retrieves one by one all movies by id (from 0 to 8000) and creates a XML document that is saved on the local server.
Of course it takes a bunch of time, and PHP says “504 Gateway Time-out The server didn’t respond in time.”
What can I do???? any sugestions!!!
Assuming a one-time execution and it’s bombing on you, you can
set_time_limitto 0 and allow it to execute.However, I would make sure this is not in production and it will only be ran when you want it to (otherwise this will place (and continue to place) a large load on the server).