问题
报错信息:
Warning: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in C:phpStudyPHPTutorialWWWDVWAexternalrecaptcharecaptchalib.php on line 28
Warning: file_get_contents(https://www.google.com/recaptcha/api/siteverify): failed to open stream: Invalid argument in C:phpStudyPHPTutorialWWWDVWAexternalrecaptcharecaptchalib.php on line 28
Notice: Trying to get property of non-object in C:phpStudyPHPTutorialWWWDVWAexternalrecaptcharecaptchalib.php on line 30
解决
打开你的php.ini配置文件,定位到下图蓝色所示的位置,把extension=php_openssl.dll
前面的;
分号去掉。
最后重启服务器即可。
openSSL是一个用C++写开源的SSL加密库,https=http+SSL,所有当你打开这个模块就可以使用在URL前缀https的请求了。去掉; 注释后,重新启动Apache服务器,再访问,就不会有这个错误了。
参考:
使用PHP中的库函数file_get_contents时出现Unable to find the wrapper "https"错误解决 - Hacker的博客 - CSDN博客