Buy Now
Sign in

Chronoforms 6 curl workaround required for Google ReCaptcha/NoCaptcha

cirymarr , May 16 at 16:28


I'm using Chronoforms 6 (for the first time, on a development site), having used Chrono5 on nearly 100 sites up until now.

I have to have Google ReCaptcha/NoCaptcha operational, however, it is not working.

My shared hosting does not allow/cater for the PHP enabling of file_get_contents, so I need another solution.

I had a workaround to get Google NoCaptcha to work on Chronoform5 in the check_nocaptcha.php file as follows:

// Original code $response = file_get_contents("".$config->get('secret_key')."&response=".$form->data('g-recaptcha-response'));

Replaced with:

$ch = curl_init("".$config->get('secret_key')."&response=".$form->data('g-recaptcha-response'));
curl_setopt($ch, CURLOPT_FRESH_CONNECT, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
$response = json_decode($response, true);

However, I can't find the corresponding file check_nocaptcha.php in Chronoforms 6

I set error reporting to Maximum and get the following response after submitting the form:

Warning: file_get_contents(): https:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /var/www/vhosts/86/876293/webspace/httpdocs/ on line 9

Could you help me please? The link to my Chrono 6 form is

I know very little about PHP, and tried to implement my Chrono 5 change in the google_nocaptcha_output.php without success.

Thanks in advance


Hi cirymarr,

Please send me a message using the "contact us" page to get a patch file with this update.

Best regards,

If your main question got answered then please mark the answer using the button!