服务器 Gind.cn

服务器问题集锦,包括 Linux(Ubuntu, Centos,Debian等)和Windows Server服务器

如何解决导致Segmenation故障的PHP脚本?

我贴在stackoverflow.com以及因为我不知道这是一个编程问题或服务器问题。 我使用的是Ubuntu 9.10,apache2,mysql5和php5。 我注意到我的一些PHP程序有一个不寻常的问题。 有时在浏览profile.edit.php等页面时,浏览器会popup一个对话框,要求下载profile.edit.php页面。 当我下载它时,文件中没有任何内容。 profile.edit.php应该是一个编辑用户信息的Web表单。 我也注意到我的一些其他的PHP页面。 我看我的Apache错误日志,我看到一个分段错误消息: [Mon Mar 08 15:40:10 2010] [notice] child pid 480 exit signal Segmentation fault (11) 而且,这个问题可能会也可能不会出现,取决于我在哪个服务器上部署我的应用程序。 更多详细信息这不会一直发生。 它只发生有时。 例如,profile.edit.php将正确加载。 但只要我点击保存button(表单action =“profile.edit.php?save = true”),那么页面会要求我下载profile.edit.php。 难道有时我的PHP脚本会消耗太多的资源吗? 示例代码 保存动作后,我的profile.edit.php包含一个data_access_object.php文件。 我将data_access_object.php中的代码追溯到这里 if($params[$this->primaryKey]) { $q = "UPDATE $this->tableName SET ".implode(', ', $fields)." WHERE ".$this->primaryKey." = ?$this->primaryKey"; $this->bind($this->primaryKey, $params[$this->primaryKey], $this->tblFields[$this->primaryKey]['mysqlitype']); } else { […]