Thanks for the post Andrea.
I was able to display the recaptcha in the form. But when i am submitting the form, i am getting an error : Could not open socket.
When i debugged the code i found that the error was due to : php_network_getaddresses: getaddrinfo failed.
Please help, what i need to remove this error?