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
.测试....成功!!!!
反正以上设置我不知道是否必须.反正这个设置必须的.呵呵呵.写在这里备忘,希望对找到这的人也有帮助
相关文档:
getenv() 取得系统的环境变量(预定义变量)
$spager=getenv('SERVER_NAME');
“PHP_SELF”
当前正在执行脚本的文件名,与 document root 相关。举例来说,在 URL 地址为 [url]http://example.com/test.php/foo.bar[/url] 的脚本中使用 $_SERVER['PHP_SELF'] 将会得到 /test.php/foo.bar 这个结 ......
1.如果一个方法可静态化,就对它做静态声明。速率可提升至4倍。
2.echo 比 print 快。
3.使用echo的多重参数(译注:指用逗号而不是句点)代替字符串连接。
4.在执行for循环之前确定最大循环数,不要每循环一次都计算最大值。
5.注销那些不用的变量尤其是大数组,以便释放内存。
6.尽量避免使用__get,__set,__auto ......
import flash.net.FileFilter;
import flash.net.FileReferenceList;
import fl.controls.Button;
import flash.events.MouseEvent;
import flash.events.Event;
import flash.events.ProgressEvent;
import flash.events.HTTPStatusEvent;
import flash.display.Loader;
import flash.net.URLRequest;
var ......
$client = new SoapClient('http://www.webxml.com.cn/WebServices/ChinaZipSearchWebService.asmx?WSDL');
#$ret = $client->__call('getSupportProvince', array());
#$ret = $client->__call('getSupportProvinceCity', array());
$ret = $client->__call('getSupportCity', array('callP ......
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>和< ......