1.0 Error
The login form for a Drupal based site had the username, password and recaptcha fields. However, instead of showing the image and input box, recaptcha displayed “ERROR for site owner, Invalid domain for site key”. Thus, it became impossible to login to the site. This effectively locked access to the administration menu of the site.
2.0 Solution
- Login to the web server from the command line using SSH.
- Go to the website root directory, say /www/website. Go to the modules directory, /www/website/sites/all/modules. Remove the recaptcha sub-directory, by giving the command, rm -fr recaptcha.
- Stop the webserver. Clear the cached files and restart the webserver. Also clear the browser cached files.
- Reopen the login page in browser. Now, the captcha should not be present in the form and it should be possible to login giving the username and password.
- Download the latest version of recaptcha from the recaptcha page. Install the recaptcha module.
- Generate an API key pair from here.
- Configure the recaptcha module by entering the site key and secret key.