|
I've got a import function for one of my apps, and it worked great (with another host and my localhost), but on Webfaction it's not working. Due to the executiontime of nearly 15 minutes, I want to quit the request, give the user a 'busy with importing' message and continue the script in the background. On my localhost (and on a place hosted somewhere else) it works fine. On Webfaction the page keeps loading (for about 10 minutes) and after that gives a server error: Error: 504 Gateway Timeout. What can be the problem and how can I fix this?
showing 5 of 6
show all
|
I just tried this with a test account on your server and had the same problem that you described. What sort of PHP deployment are you using on your other hosts - mod_php, CGI, FastCGI, something else?
On my localhost I use WAMP (so that could react differently). The server I used for testing is a server of AppFog. They also use appache and Linux, but they have some kind of accelerator installed.
The code above works on both, but is also working on lots of other servers. See http://stackoverflow.com/questions/10504753/can-i-cause-a-redirect-to-occur-before-my-php-script-finishes
It looks like webfaction uses software to keep the connection open or something? Or does add something to the content so the content-length is not 0?
I also found other people for who this script is not working: http://stackoverflow.com/questions/11818702/php-redirect-user-and-continue-process-script
Do you have any clue?
Hi,
I wasn't able to make this code work properly on our servers, using PHP 5.2, 5.3, 5.4 both via CGI and FastCGI.
I'd also suggest looking at this post on StackOverFlow.
I can try one of the libraries for queueing, but it seems a little bit exorbitant for what I'm trying to do.
One of the solutions in the stackoverflow post you are linking to is exactly what I want to do. But that's the thing that's not working.
I don't know why it doesn't work on our servers - perhaps it only works when PHP is installed as an Apache module. You can try installing a local instance of Apache with mod_php in your account if you want to test this possibility.
Ok, thanks.