Fatal error: Maximum execution time of 30 seconds exceeded in C:\Tomcat4\webapps\ROOT\com\wuwu\index.php3 on line 93 对不起!请原谅,谁都知道是超时,我知道你想要的是解决方法,那我来分析分析吧:请问你其它的程序可不可以用?如果可以用的话就是程序的问题,请SHOW你的程序。让大家来帮助你解决(这里高手多呀)。反之则是PHP的问题了,我以前也遇到过超时问题,是版本不兼容,最后我换了个版本就可以了。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 php.ini中调整max_execution_time的值。出现这样的问题与网络状况以及用户计算机的响应速度有关,不一定是高版本就能够解决的问题。另外在php4.3.3-dev中已经将mysql的timeout时间默认设置成60,就是为了解决在数据库操作中出现操作完成之后长期占用进程,从而产生所诉问题。这个问题从服务器端是不可能彻底解决的。比如如果有人用dos攻击,那么任何一个正常用户的操作都将会timeout! 是超时错误,有时候上传文件太大,或是执行的程序太大,涉及动作较多,运行太慢时就会产生这个错误。解决办法就是在运行的程序前面加上 set_time_limit(0); 你试试吧,如果你写的程序不是死循环的话,一般都能解决的,^_^ 我在redhat linux和window 2k里运行的!其他程序有的正常,有的不正常!就是循环太多,有没有优化的余地?pinclude("../../includes/config.php");$ver_id=1057572090;$userid=2;$mod=84;$exptime=20030805;///////////////////////////////////////$date = getdate(); $yy = $date['year']; $dd= $date['mday']; $mm= $date['mon']; if($mm<10){ $mm="0".$mm; } if($dd<10){ $dd="0".$dd; } $nowtime=$yy.$mm.$dd;////////////////////////////////////////if($nowtime>$exptime && $LOOK!="ok"){header("location:../../exp.htm");}if($file==""){$file="index.php3";}if(isset($REF_PAGE)){ $refpage=$REF_PAGE; $direct="N";}else{ $direct="Y";}$opendir="$baseurl/mod/$mod/";$openfile=$opendir.$file;$openfile=$openfile."?kdir=$kdir&nowdir=$nowdir&userid=$userid&id=$id&detail=$detail";if($QUERY_STRING==""){ $filestring="file=index.php3.htm";}else{ $filestring=$QUERY_STRING.".htm";} setcookie("REF_PAGE",$filestring);$kk=3;if(file_exists($filestring)){ $fx=fopen($filestring,"r"); $pp=fgets($fx,100); fclose($fx); if(trim($pp)=="<!-- $ver_id -->"){ include($filestring); }else{ $kk=1; }}else{ if($filestring=="file=index.php3.htm"){ $kk=1; }elseif($direct=="Y"){ $kk=0; }else{ if(file_exists($refpage)){ $ffp=fopen($refpage,"r"); $fcon=fread($ffp,120000); if(strstr($fcon,$QUERY_STRING.">")){ $kk=1; }else{ $kk=0; } fclose($ffp); }else{ $kk=0; } }}if($kk==0){ $fd=fopen($openfile,"r"); $con = fread($fd,120000); $con=str_replace("images/","$opendir/images/",$con); $con=str_replace("<?","",$con); $con=str_replace("<%","",$con); $con=str_replace("language=php","",$con); $con=str_replace("language='php'","",$con); $con=str_replace('language="php"','',$con); fclose($fd); echo "$con";}if($kk==1){ $fd=fopen($openfile,"r"); $con = fread($fd,120000); $con=str_replace("images/","$opendir/images/",$con); fclose($fd); $con=str_replace("<?","",$con); $con=str_replace("<%","",$con); $con=str_replace("language=php","",$con); $con=str_replace("language='php'","",$con); $con=str_replace('language="php"','',$con); echo "$con"; $fp=fopen($filestring,"w"); fwrite($fp,"<!-- $ver_id -->\n",100); $con=str_replace("\t","",$con); $con=str_replace("\r","",$con); $con = ereg_replace(">([ ]+)<", "><", $con); $con = ereg_replace("\n([ ]+)<", "\n<", $con); $con = ereg_replace("([\n]+)", "\n", $con); fwrite($fp,$con,strlen($con)); fclose($fp); chmod($filestring,0666);}?>谢谢! netbeans6.7如何自动换行 onkeyDown事件问题 大哥们帮帮忙 求一个IIS下的httpd.ini的规则 想问下 搜索引擎 是怎么实现的? 怎么样实现PHP读取照片的EXIF信息? php无限分类报错怎么解决 $tpl = new rFastTemplate("./tpl"); 如何把一组复选框选中的值分开存入数据库呢??? 高手回答 用正则在正文中匹配[IMG]picture20030707165122.gif[/IMG],并取出[IMG]与[/IMG]中的字符串。 **用一个SQL语句,将数据插入到二个表中**
就是循环太多,有没有优化的余地?
pinclude("../../includes/config.php");
$ver_id=1057572090;
$userid=2;
$mod=84;
$exptime=20030805;
///////////////////////////////////////
$date = getdate();
$yy = $date['year'];
$dd= $date['mday'];
$mm= $date['mon'];
if($mm<10){
$mm="0".$mm;
}
if($dd<10){
$dd="0".$dd;
}
$nowtime=$yy.$mm.$dd;////////////////////////////////////////
if($nowtime>$exptime && $LOOK!="ok"){
header("location:../../exp.htm");
}
if($file==""){
$file="index.php3";
}
if(isset($REF_PAGE)){
$refpage=$REF_PAGE;
$direct="N";
}else{
$direct="Y";
}
$opendir="$baseurl/mod/$mod/";
$openfile=$opendir.$file;
$openfile=$openfile."?kdir=$kdir&nowdir=$nowdir&userid=$userid&id=$id&detail=$detail";
if($QUERY_STRING==""){
$filestring="file=index.php3.htm";
}else{
$filestring=$QUERY_STRING.".htm";
}
setcookie("REF_PAGE",$filestring);
$kk=3;
if(file_exists($filestring)){
$fx=fopen($filestring,"r");
$pp=fgets($fx,100);
fclose($fx); if(trim($pp)=="<!-- $ver_id -->"){
include($filestring);
}else{
$kk=1;
}
}else{
if($filestring=="file=index.php3.htm"){
$kk=1;
}elseif($direct=="Y"){
$kk=0;
}else{
if(file_exists($refpage)){
$ffp=fopen($refpage,"r");
$fcon=fread($ffp,120000);
if(strstr($fcon,$QUERY_STRING.">")){
$kk=1;
}else{
$kk=0;
}
fclose($ffp);
}else{
$kk=0;
} }
}if($kk==0){
$fd=fopen($openfile,"r");
$con = fread($fd,120000);
$con=str_replace("images/","$opendir/images/",$con);
$con=str_replace("<?","",$con);
$con=str_replace("<%","",$con);
$con=str_replace("language=php","",$con);
$con=str_replace("language='php'","",$con);
$con=str_replace('language="php"','',$con);
fclose($fd);
echo "$con";
}
if($kk==1){
$fd=fopen($openfile,"r");
$con = fread($fd,120000);
$con=str_replace("images/","$opendir/images/",$con);
fclose($fd);
$con=str_replace("<?","",$con);
$con=str_replace("<%","",$con);
$con=str_replace("language=php","",$con);
$con=str_replace("language='php'","",$con);
$con=str_replace('language="php"','',$con);
echo "$con";
$fp=fopen($filestring,"w");
fwrite($fp,"<!-- $ver_id -->\n",100);
$con=str_replace("\t","",$con);
$con=str_replace("\r","",$con);
$con = ereg_replace(">([ ]+)<", "><", $con);
$con = ereg_replace("\n([ ]+)<", "\n<", $con);
$con = ereg_replace("([\n]+)", "\n", $con);
fwrite($fp,$con,strlen($con));
fclose($fp);
chmod($filestring,0666);
}
?>谢谢!