My PHP code is timing out with the following error:
This request takes too long to process, it is timed out by the server. If it should not be timed out, please contact administrator of this web site to increase 'Connection Timeout'
I'm not sure why this is happening. This is my code:
if(!in_array($name,$names)){
mysql_query("INSERT INTO `tbl` (`name`, `time`, `link`) VALUES ( '$name', '$time', '$link');");
} else {
mysql_query("UPDATE `tbl` SET `time` = '$time', `link` = '$link' WHERE `pishkhan`.`name` = $name;");
echo $name.'<br/>';
}
file_put_contents('test/albums/news/'.$name.".jpg", fopen($link, 'r'));
Session timeout can be customized, to make the user’s page inactive after a fixed time. Starting session: The PHP, session_start () function is used to start a session in the web page. Session variables: After the start of the session, session variables can be created for future use.
First, set session.gc_maxlifetime to the desired session timeout, in seconds. E.g. if you want your sessions to timeout after 30 minutes, set session.gc_maxlifetime to 1800 (60 seconds in a minute * 30 minutes = 1,800 seconds). What this does is ensure a given session file on the server can live for at least that long.
Increasing the timeout in php.ini by adding a line: max_execution_time = {number of seconds i.e. 60 for one minute}. Increasing the timeout in your script itself by adding: ini_set('max_execution_time','{number of seconds i.e. 60 for one minute}');
Step 2) Click on the main connection (not specific to any particular domain). Step 3) Under the IIS section, find FastCGI Settings (shown below). Step 4) Therein, right-click the PHP application and select Edit.... Step 5) Check the timeouts (shown below).
As I stated in my answer here, this particular error message is generated by the LiteSpeed web server (a faster replacement for Apache). It has a special feature whereby it cancels long-running scripts (even those that use set_time_limit()
). To disable this, you need to put the following in your .htaccess
file in the root of your site.
RewriteEngine On
RewriteRule .* - [E=noabort:1]
RewriteRule .* - [E=noconntimeout:1]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With