OJS 2.4.8.1 captcha does not work

Hi,

I’m starting now with OJS, and I need active the recaptcha v2 on OJS 2.4.8-1.

config.inc.php:
[captcha]
captcha = on
captcha_on_register = on
captcha_on_comments = on
captcha_on_mailinglist = on
font_location = https://www.google.com/recaptcha/api/siteverify
recaptcha = on
recaptcha_version = 2
recaptcha_public_key = 6Ld3…
recaptcha_private_key = 6Ld…

I did this change:

After that, the recaptcha worked in my localhost. When I applied these changes to the server the recaptch didn’t work.

My localhost:

  • SO: Windows
  • PHP Version 5.6.36
  • Apache/2.4.33 (Win32) OpenSSL/1.0.2o PHP/5.6.36
  • modules: core mod_win32 mpm_winnt http_core mod_so mod_access_compat mod_actions mod_alias mod_allowmethods mod_asis mod_auth_basic mod_authn_core mod_authn_file mod_authz_core mod_authz_groupfile mod_authz_host mod_authz_user mod_autoindex mod_cgi mod_dav_lock mod_dir mod_env mod_headers mod_include mod_info mod_isapi mod_log_config mod_cache_disk mod_mime mod_negotiation mod_proxy mod_proxy_ajp mod_rewrite mod_setenvif mod_socache_shmcb mod_ssl mod_status mod_version mod_php5

my server:

  • SO: Linux, ubuntu.
  • PHP Version 5.6.30-7+deb.sury.org~xenial+1
  • Apache/2.4.18 (Ubuntu)
  • Modules: core mod_so mod_watchdog http_core mod_log_config mod_logio mod_version mod_unixd mod_access_compat mod_actions mod_alias mod_allowmethods mod_asis mod_auth_basic mod_authn_core mod_authn_file mod_authz_core mod_authz_groupfile mod_authz_host mod_authz_user mod_autoindex mod_cache mod_cache_disk mod_cgi mod_dav mod_dav_fs mod_dav_lock mod_deflate mod_dir mod_env mod_filter mod_headers mod_include mod_mime prefork mod_negotiation mod_php5 mod_proxy mod_proxy_ajp mod_rewrite mod_setenvif mod_socache_shmcb mod_ssl mod_status

What can it be?

You may find more information in your server’s PHP error log. For example, one thing that could cause this difference is if PHP on your server is restricted from making external HTTP calls, or if it requires a proxy.