Recaptcha error - ReCaptcha\ReCaptcha Class not found

edited March 2018 in News & Announcements

Okay first off this is running on localhost so I get a javascript alert: Cannot contact reCAPTCHA. Check your connection and try again.

Now, if I complete the form; ignoring the Recaptcha and hit submit I get the following error. Where can I find the Recaptcha Class?


( ! ) Fatal error: Class 'ReCaptcha\ReCaptcha' not found in /vagrant/html/ on line 148

A PHP Error was encountered
Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /vagrant/html/

Filename: core/Common.php

Line Number: 578


A PHP Error was encountered
Severity: Error

Message: Class 'ReCaptcha\ReCaptcha' not found

Filename: helpers/forms_helper.php

Line Number: 148



  • edited 11:16AM
    See these issues on GitHub for more references:

    Sounds like you'll need the vendor package installed with composer.
  • rl2rl2
    edited 11:16AM
    Well that's one thing solved.

    The next problem is that if I complete the form, but ignore the Recaptcha I can still submit the form! How do I tell Fuel/CodeIgniter that the Recaptcha is mandatory?
  • edited 11:16AM
    The Forms_custom_fields.php file has a recaptcha method in it which is used to render the recaptcha form field. In that method it has a line used to validate the recaptcha on post process:
    $validator->add_rule("recaptcha_response_field", "validate_recaptcha", "'.$params['error_message'].'", array("'.$params['recaptcha_private_key'].'"));
    The "validate_recaptcha" is a function that is in the forms_helper.php file and will return a TRUE boolean value if it is valid. My guess is that there needs to be some adjustment there.
Sign In or Register to comment.