通过添加两个变量,我在phpMyAdmin中添加了recaptcha
$cfg‘’CaptchaLoginPublicKey‘= 'Site key'; $cfg‘’CaptchaLoginPrivateKey‘=’秘密密钥‘;
但下面有错误。
Warning in ./libraries/plugins/auth/recaptcha/ReCaptcha/RequestMethod/Post.php#68
file_get_contents(): https:// wrapper is disabled in the server configuration by allow_url_fopen=0
Backtrace
./libraries/plugins/auth/recaptcha/ReCaptcha/RequestMethod/Post.php#68: file_get_contents(
string 'https://www.google.com/recaptcha/api/siteverify',
boolean false,
resource,
)
./libraries/plugins/auth/recaptcha/ReCaptcha/ReCaptcha.php#94: ReCaptcha\RequestMethod\Post->submit(object)
./libraries/plugins/auth/AuthenticationCookie.class.php#366: ReCaptcha\ReCaptcha->verify(
string '03AHJ_VuvVnV4jlI2mNDNogB6eajU4jE--F7ve8zMdP0Xf636gaBeNE_dK9-',
string '10.0.5.1',
)
./libraries/common.inc.php#896: AuthenticationCookie->authCheck()
./index.php#12: require_once(./libraries/common.inc.php)
Warning in ./libraries/plugins/auth/recaptcha/ReCaptcha/RequestMethod/Post.php#68
file_get_contents(https://www.google.com/recaptcha/api/siteverify): failed to open stream: no suitable wrapper could be found
Backtrace
./libraries/plugins/auth/recaptcha/ReCaptcha/RequestMethod/Post.php#68: file_get_contents(
string 'https://www.google.com/recaptcha/api/siteverify',
boolean false,
resource,
)
./libraries/plugins/auth/recaptcha/ReCaptcha/ReCaptcha.php#94: ReCaptcha\RequestMethod\Post->submit(object)
./libraries/plugins/auth/AuthenticationCookie.class.php#366: ReCaptcha\ReCaptcha->verify(
string '03AHJ_VuvVnV4jlI2mNDNogB6eajU4jE--F7ve',
string '10.0.5.1',
)
./libraries/common.inc.php#896: AuthenticationCookie->authCheck()
./index.php#12: require_once(./libraries/common.inc.php)所以我想打开allow_url_fopen for phpMyAdmin。我将/etc/php5 5/apache2/php.ini和/etc/php5 5/fpm/php.ini改为
allow_url_fopen = On allow_url_include = On
根phpinfo向我显示正确的设置。
Directive Local Value Master Value
allow_url_fopen On On
allow_url_include On On但是,在phpMyAdmin文件夹中。
Directive Local Value Master Value
allow_url_fopen Off On
allow_url_include On On因此,我尝试在phpMyAdmin文件夹中测试PHP。
ini_set("allow_url_fopen",真); 如果(ini_get( "allow_url_fopen ") == true) { echo“allow_url_fopen ON";} 否则{回波"allow_url_fopen已关闭“;} 打印ini_get("allow_url_fopen"); 打印ini_get("allow_url_include"); 出口;
allow_url_fopen is OFF01我还试图在.htaccess文件夹中添加phpMyAdmin。
php_value allow_url_fopen On
为什么不能在phpMyAdmin文件夹中更改本地值?
我的服务器是Debian8.2,PHP5.6.17,phpMyAdmin4.5,MySQL5.7,它位于防火墙后面。
我知道将全局allow_url_fopen设置为On是危险的。如何将其仅设置为phpMyAdmin文件夹可用?
发布于 2016-03-05 17:19:17
谢谢团。是的,你是对的。我修改了vhost,现在起作用了。
vim /etc/apache2/conf-现有/phpmyadmin.conf php_admin_flag allow_url_fopen On php_admin_flag allow_url_include On
https://stackoverflow.com/questions/35762374
复制相似问题