PHP调用存储过程超时解决方法
最近工作中遇到一个头疼的问题:php中调用一个存储过程(要复制N多数据的.),由于此过程执行时间很长.导致php总是超时错误:
Service Temporarily Unavailable
The
server is temporarily unable to service your request due to maintenance downtime
or capacity problems
.
Please
try
again
later
.
问题折腾了好久,一直没找到原因.分别是:
php开头加上: set_time_limit(0);
不管用.
php.ini中设置timeout的时间:
session.cookie_lifetime = 0
session.gc_maxlifetime =
3440
pfpro.defaulttimeout = 3600
max_execution_time =
3600
max_input_time = 3600 ;
还是不管用.
设置mysql的配置文件my.ini:
connect_timeout=3600
wait_timeout=2880000
interactive_timeout
= 2880000
max_allowed_packet = 10M
还是还是不管用.
Apache中设置httpd.conf 超时:
#Timeout:
Sec.
Timeout 360000
#KeepAlive: Off | On
KeepAlive
On
#MaxKeepAliveRequests:
MaxKeepAliveRequests
0
#KeepAliveTimeout:
KeepAliveTimeout 600
继续不管用.晕死了...
今天继续找原因.哈哈哈哈.竟然在C:\Program
Files\Zend\ZendServer\etc\ZendEnablerConf.xml
中找到一个timeout属性.<Timeouts ConnectionTimeout='60' requestTimeout='120'
/>
难道是这个原因??120改成1200
.测试....成功!!!!
反正以上设置我不知道是否必须.反正这个设置必须的.呵呵呵.写在这里备忘,希望对找到这的人也有帮助
相关文档:
<?php
echo "<br>";
?>
<?php
function GetIP()
{
if(!empty($_SERVER["HTTP_CLIENT_IP"]))
$cip = $_SERVER["HTTP_CLIENT_IP"];
else if(!empty($_SERVER["HTTP_X_FORWARDED_FOR"]))
$cip = $_SERVER["HTTP_X_FORWARDED_FOR"];
else if(!empty($_SERVER ......
简述题(50分)()
1、用PHP打印出前一天的时间格式是2006-5-10 22:21:21(2分)
echo date('Y-m-d H:i:s', strtotime('-1 day'));
或者
$yesterday = time() - (24 * 60 * 60);
echo 'today:'.date('Y-m-d H:i:s')."\n";
echo 'yesterday:'. date('Y-m-d H:i:s', $yesterday)."\n";
2、echo(),print(),print_r()的区别( ......
<html>
<head><title>文件上传</title></head>
<body alink="#FF0000" link="#000099" vlink="#CC6600" topmargin="8" leftmargin="0" bgColor="#FFFFCC">
<?php
if(!$_POST['upload'])
{
?>
<form enctype="multipart/form-data" action="upload.php" method="post"& ......
/*
用PHP的DOM控件来创建XML输出
设置输出内容的类型为xml
*/
header('Content-Type: text/xml;');
//创建新的xml文件
$dom = new DOMDocument('1.0', 'utf-8');
//建立<response>元素
$response = $dom->createElement('response');
$dom->appendChild($response);
//建立<books>元素并将其作 ......
php特殊字符过滤
1、过滤标签(HTML):strip_tags()
例如:
<?php
$text = '<?php ?><p>Test paragraph.</p><!-- Comment -
-> <a href=http://topic.csdn.net/u/20090311/09/"#fragment">Other text</a>';
echo strip_tags($text);
echo "\n";
// 允许使用<p>和< ......