Question

I have a site hosted on rackspace cloud sites. I have a troubleshooting script I am trying to run to figure out some problems with the site.

Cloud sites has a 30 second timeout and it is timing out before the results page can load. I spoke with their support and they advised me to put a page loading script at the top of the php file to keep the connection open but I have no idea how to do that and the googling I have done hasnt been much help.

The script I am trying to run is too long to include here but if anyone needs it you can find it here http://forum.joomla.org/viewtopic.php?f=621&t=582860

edit: so no matter what I set the execution time to in the script the load balancers rackspace uses will still timeout after 30 seconds. they have told me to run a 'page loading' script at the beginning of the script to keep the connection open so I am about to start looking into how to do that.

Was it helpful?

Solution

You could try the set_time_limit() function:

http://php.net/manual/en/function.set-time-limit.php

OTHER TIPS

By default, a PHP script times out after 30 seconds.

Use the set_time_limit( int $seconds ) function to extend the maximum execution time.

You can also use ini_set() and set the max_execution_time:

ini_set("max_execution_time", 300);

EDIT

if the above doesn't work, then they probably use a secondary mechanism to timeout blocking connections. What you could try in this situation is to flush some data at a regular interval.

ob_start(); // enable output buffering

// output something at regular interval
echo " ";
ob_flush();

// at end of script
ob_end_flush();

Hope this helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top