首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >allow_url_fopen局部变量

allow_url_fopen局部变量
EN

Stack Overflow用户
提问于 2016-03-03 03:01:37
回答 1查看 2.1K关注 0票数 2

通过添加两个变量,我在phpMyAdmin中添加了recaptcha

$cfg‘’CaptchaLoginPublicKey‘= 'Site key'; $cfg‘’CaptchaLoginPrivateKey‘=’秘密密钥‘;

但下面有错误。

代码语言:javascript
运行
复制
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向我显示正确的设置。

代码语言:javascript
运行
复制
Directive           Local Value    Master Value
allow_url_fopen     On             On
allow_url_include   On             On

但是,在phpMyAdmin文件夹中。

代码语言:javascript
运行
复制
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"); 出口;

代码语言:javascript
运行
复制
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文件夹可用?

EN

回答 1

Stack Overflow用户

发布于 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

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/35762374

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档