Aaron Jan Baldomar Aaron Jan Baldomar - 1 year ago 143
HTML Question

php - page took too long to respond

html file redirects to php page called index.php and index.php is a recaptcha php file from google


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(

if ($resp != null && $resp->success) {
require_once 'gmail.php';
header('Location: ../failed.html');


When page loads it shows that the page took too long to respond. The webaddress is still example.com/php/index.php. I've done this on xampp and another website and it works. What could possibly be the reason? Do I need to contact the webhost?

is there are a way to know where in line of code the error occured?

edit: It has my siteKey and secretkey . I removed it in this case

Answer Source

To show php errors, put this at the top of your script:

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

Also try putting either:




after your header('location...

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download