DVWA设置PHP函数allow_url_include:已禁用

时间:2015-12-14 18:53:33

标签: php mysql windows apache xampp

我通过XAMPP在Windows上设置DVWA,我在Google搜索了大约24小时 - 我似乎无法找到答案。

我的问题是设置服务器:

PHP function `allow_url_include: Disabled`

我的配置文件显示已启用。它可能与我的端口有关吗?我应该设置我的服务器以便外部访问我的路由器,还是内部IP访问足够?

设置我的服务器时,我得到了这个:

  

数据库设置

     

点击“创建/重置数据库”'按钮下面创建或重置您的数据库。

     

如果收到错误,请确保您拥有正确的用户凭据:C:\ XAMPP \ htdocs \ dvwa / config / config.inc.php

     

设置检查   操作系统:Windows   后端数据库:MySQL   PHP版本:5.5.30

     

Web Server SERVER_NAME:192.168.0.13

     

PHP函数display_errors:启用(简易模式!)   PHP函数safe_mode:已禁用   PHP函数allow_url_include:已禁用   PHP函数allow_url_fopen:已启用   PHP函数magic_quotes_gpc:已禁用   PHP模块php-gd:已安装

     

reCAPTCHA键:缺少

     

可写文件夹C:\ XAMPP \ htdocs \ dvwa / hackable / uploads /:是)   可写文件C:\ XAMPP \ htdocs \ dvwa / external / phpids / 0.6 / lib / IDS / tmp / phpids_log.txt:是

     

状态显示为红色,表示尝试完成某些模块时会出现问题。

6 个答案:

答案 0 :(得分:6)

要解决此问题,请转到:

C:\xampp\php\php.ini

并改变:

allow_url_include=Off

要:

allow_url_include=On

然后转到:

C:\xampp\htdocs\DVWA\config\config.inc.php

并改变:

$_DVWA[ 'recaptcha_public_key' ]  = ' ';
$_DVWA[ 'recaptcha_private_key' ] = ' ';

分为:

$_DVWA[ 'recaptcha_public_key' ]  = '6LdK7xITAAzzAAJQTfL7fu6I-0aPl8KHHieAT_yJg';
$_DVWA[ 'recaptcha_private_key' ] = '6LdK7xITAzzAAL_uw9YXVUOPoIHPZLfw2K1n5NVQ';

答案 1 :(得分:4)

我知道现在已经有两周了,但为了解决这个问题,你需要修改php.ini,至少在Linux上是这样。我还没有在Windows上遇到过这个问题,但这里有你需要改变的行:

; Whether to allow include/require to open URLs (like http:// or ftp://) as files.
; http://php.net/allow-url-include
allow_url_include=Off

将最后一行更改为:

allow_url_include=on

现在,重新启动Apache服务器并重新加载URL。

答案 2 :(得分:2)

找到它用于Windows和XAMPP安装。不必费心更改位于php.ini文件夹中的DVWA文件中的值。相反,查找位于XAMPP安装目录中的php.ini,例如C:\xampp\php\php.ini

搜索字符串:

allow_url_include=

将值更改为allow_url_include=On并重新启动apache

答案 3 :(得分:1)

发现问题配对,但这适用于Windows但可能适用于您

  

你需要在“phpForApache.ini”而不是“php.in”中应用更改

答案 4 :(得分:0)

对于Kali Linux,编辑“ apache2宽” php.ini对我有用:

# updatedb
# locate php.ini
/etc/php/7.2/apache2/php.ini
/etc/php/7.2/cli/php.ini
/usr/lib/php/7.2/php.ini-development
/usr/lib/php/7.2/php.ini-production
/usr/lib/php/7.2/php.ini-production.cli
/var/www/html/DVWA-master/php.ini
# nano /etc/php/7.2/apache2/php.ini

CTRL + W ,搜索 allow_url_include ,将其设置为On

# service restart apache2

并且您应该启用 allow_url_include

allow_url_include

答案 5 :(得分:-1)

在ubuntu上提出同样的问题并解决它。只需设置 SELECT id as name, (SELECT sum(captured_profit) from me where (date BETWEEN '2017-01-01' AND '2017-01-31') and id = name) as January, (SELECT sum(captured_profit) from me where (date BETWEEN '2017-02-01' AND '2017-02-31') and id = name) as February, (SELECT sum(captured_profit) from me where (date BETWEEN '2017-03-01' AND '2017-03-31') and id = name) as March, (SELECT sum(captured_profit) from me where (date BETWEEN '2017-04-01' AND '2017-04-31') and id = name) as April, (SELECT sum(captured_profit) from me where (date BETWEEN '2017-05-01' AND '2017-05-31') and id = name) as May, (SELECT sum(captured_profit) from me where (date BETWEEN '2017-06-01' AND '2017-06-31') and id = name) as June, (SELECT sum(captured_profit) from me where (date BETWEEN '2017-07-01' AND '2017-07-31') and id = name) as July, (SELECT sum(captured_profit) from me where (date BETWEEN '2017-08-01' AND '2017-08-31') and id = name) as August, (SELECT sum(captured_profit) from me where (date BETWEEN '2017-09-01' AND '2017-09-31') and id = name) as September, (SELECT sum(captured_profit) from me where (date BETWEEN '2017-10-01' AND '2017-10-31') and id = name) as October, (SELECT sum(captured_profit) from me where (date BETWEEN '2017-11-01' AND '2017-11-31') and id = name) as November, (SELECT sum(captured_profit) from me where (date BETWEEN '2017-12-01' AND '2017-12-31') and id = name) as December, (SELECT sum(captured_profit) from me where (date BETWEEN '2017-11-01' AND '2017-12-31') and id = name) as Total, from me where id is not null group by id;