佩奇过了很长时间才做出回应


page took too long to respond

html文件重定向到PHP页面index.php和index.php是一个recaptcha PHP文件从谷歌

<?php

require_once "recaptchalib.php";
// Register API keys at https://www.google.com/recaptcha/admin
$siteKey = "*";
$secret = "*";
// reCAPTCHA supported 40+ languages listed here: https://developers.google.com/recaptcha/docs/language
$lang = "en";
// The response from reCAPTCHA
$resp = null;
// The error code from reCAPTCHA, if any
$error = null;
$reCaptcha = new ReCaptcha($secret);
// Was there a reCAPTCHA response?
if ($_POST["g-recaptcha-response"]) {
    $resp = $reCaptcha->verifyResponse(
        $_SERVER["REMOTE_ADDR"],
        $_POST["g-recaptcha-response"]
    );
}
 if ($resp != null && $resp->success) {
    require_once 'gmail.php';
    }else{
    header('Location: ../failed.html');
}
?>

当页面加载时,显示页面响应时间过长。网址仍然是example.com/php/index.php。我在xampp和另一个网站上做过这个,它很有效。可能是什么原因呢?我需要联系网站主机吗?

是否有一种方法可以知道代码中发生错误的地方?

它有我的siteKey和secretkey。我把它删除了

要显示php错误,请将以下内容放在脚本的顶部:

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

也可以试着输入:

exit();

die(); 

在你的header('location...

之后