我有以下代码,从管理区域保存后会创建HTML内容正文的副本。问题是如果我将max_length设置为160以上,我会收到连接重置错误。
我的代码有问题吗?或者这对于apache / php来说是否太简单了?
content_body可以是从TinyMCE输入的大块HTML文本。
if($oRequest->get("contents.content_body")){
$max_length = 255;
$long_text = strip_tags(trim($oRequest->get("contents.content_body")));
if(strlen($long_text) > $max_length){
$short_text = (substr($long_text,0,$max_length));
} else {
$short_text = $long_text;
}
try {
$db = Db_Connections::getInstance()->getConnection();
$sql = "UPDATE `contents` SET `content_body_short` = '".mysql_real_escape_string($short_text)."' WHERE content_id = ".(int)$contentID;
$db->query($sql);
} catch (Exception $e) {
throw $e;
}
}
编辑:
我尝试过添加超时(0),这没有什么区别。
错误日志不确定这是否有帮助
[Tue Sep 13 11:10:25 2011] [notice] Parent: child process exited with status 255 -- Restarting.
[Tue Sep 13 11:10:26 2011] [notice] Apache/2.2.17 (Win32) PHP/5.3.4 configured -- resuming normal operations
[Tue Sep 13 11:10:26 2011] [notice] Server built: Oct 24 2010 13:33:15
[Tue Sep 13 11:10:26 2011] [notice] Parent: Created child process 2964
[Tue Sep 13 11:10:26 2011] [notice] Child 2964: Child process is running
[Tue Sep 13 11:10:26 2011] [notice] Child 2964: Acquired the start mutex.
[Tue Sep 13 11:10:26 2011] [notice] Child 2964: Starting 64 worker threads.
[Tue Sep 13 11:10:26 2011] [notice] Child 2964: Starting thread to listen on port 80.
编辑:我发现这只发生在我的本地开发环境中并在我的Debain Squeeze服务器上完美运行
本地设置:
答案 0 :(得分:0)
你的apache,连接是否因为apache孩子摔倒时有时会出现错误,这可能有很多原因。
我被告知您正在使用win32,所以可以尝试:
希望这对你有所帮助,祝你有个美好的一天。