Admin-ajax.php failing after executing a while



Hello all,

I have a big question. I have an AJAX script calling through wordpress’ admin-ajax.php. I have all my PHP Variables set to the right setting and the script is a long one that can take upto 30 minutes to finish. (Syncing data with a RETs server).

On my local host this executes just fine. Here not so much. I have VPS service and have confirmed that I am not using up my RAM. The script is executing for about 2-3 minutes then I get a 404 Error message sent back to the AJAX error handler. But it is calling the script because it will sync about 50 to 60 listings in the meantime.

Any thoughts?


Try setting max_execution_time to 0 and using the “regular” CGI PHP setting for the domain, but even then you might hit an Apache CGI timeout.

30 minutes is a long time for a PHP script to run. It might be worthwhile considering to perform the operation in chunks or have the sync performed via calling a shell script.


A RETs server? Real Estate? Is that a plugin or a home-made script?

It would not be the first time I’ve seen plugins like that timeout, because they simply take too damn long and PHP really does want a limit. You’d think they could limit it to copy over in chucnks of 15 or something…