执行php脚本后无法访问此网站

时间:2020-05-17 03:56:02

标签: php debugging error-handling cpanel

我有一个超过400行代码的PHP脚本。一切正常,我进行了几次更新,现在浏览器显示以下错误:

This site can’t be reached
website.com unexpectedly closed the connection.

我有以下代码来显示和记录错误:

//Set maximum execution time to max value
set_time_limit(0);

//Show errors on page
ini_set('display_errors',1);

//Report all errors
error_reporting(E_ALL);

//Log errors
ini_set('log_errors', TRUE);

//Change directory to file location
$fileDir = dirname(__FILE__);
chdir($fileDir);

//Save errors in errors.txt
ini_set('error_log', $fileDir . '/errors.txt');

因此,错误应保存在文件errors.txt中,但是在该文件中我看不到任何错误。

脚本在几秒钟后停止,没有任何明显的错误。

我检查了脚本中是否有拼写错误,特别是我所做的更新,但找不到任何内容。

该脚本托管在Cpanel服务器上。有没有一种方法可以调试或查看脚本的停止位置?

例如,如何知道脚本是否超出了最大内存或CPU?尽管它只是在几秒钟而不是几分钟后停止。

0 个答案:

没有答案