How do I use reCaptcha in a vagrant development environment?

时光毁灭记忆、已成空白 提交于 2021-02-10 19:53:34

问题


I am developing using vagrant. I'd like to use reCapcha how ever I get an error when when I'm developing on local machine which is at a subdomain on the vagrant configured private network 192.168.100.100:

ERROR for site owner:
Invalid domain for site key

The recaptcha works on the production site fine. How can I setup my development environment to work with recaptcha?

In the vagrant bootstrap are the following:

<Directory "/var/www/">
    AllowOverride All
</Directory>
<VirtualHost *:80>
    DocumentRoot /var/www/app
    ServerName app.dev
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot /var/www/phpmyadmin
    ServerName phpmyadmin.dev
</VirtualHost>

I've tried adding locahost and 192.168.100.100 to my recaptcha key settings but this hasn't worked.


回答1:


Add your domain to /etc/hosts with your local vargrant IP. Then visit your domain in a browser and it should be working.



来源:https://stackoverflow.com/questions/47439938/how-do-i-use-recaptcha-in-a-vagrant-development-environment

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!