Mette
Mette

Reputation: 101

DVWA setup PHP function allow_url_include: Disabled

I'm setting up DVWA on Windows via XAMPP, and I've searched in Google for about 24 hours - I cannot seem to find the answer.

My problem is setting up the server:

PHP function `allow_url_include: Disabled`

My config file says it's enabled. Could it have something to do with my ports? Should I set up my server for outside access to my router, or is the internal IP access enough?

When setting up my server I get this:

Database Setup

Click on the 'Create / Reset Database' button below to create or reset your database.

If you get an error make sure you have the correct user credentials in: C:\XAMPP\htdocs\dvwa/config/config.inc.php

Setup Check Operating system: Windows Backend database: MySQL PHP version: 5.5.30

Web Server SERVER_NAME: 192.168.0.13

PHP function display_errors: Enabled (Easy Mode!) PHP function safe_mode: Disabled PHP function allow_url_include: Disabled PHP function allow_url_fopen: Enabled PHP function magic_quotes_gpc: Disabled PHP module php-gd: Installed

reCAPTCHA key: Missing

Writable folder C:\XAMPP\htdocs\dvwa/hackable/uploads/: Yes) Writable file C:\XAMPP\htdocs\dvwa/external/phpids/0.6/lib/IDS/tmp/phpids_log.txt: Yes

Status in red, indicate there will be an issue when trying to complete some modules.

Upvotes: 10

Views: 63013

Answers (7)

Tushar
Tushar

Reputation: 1104

Find the using php version using command: php -v (Many time more than one version of php is installed) After that go to directory /etc/php/7.4/apache2. Here 7.4 is the php version.
In that directory open file using editor or nano and add

allow_url_fopen=On
allow_url_include=On

to php.ini file.

Then, restart apache2 server using service apache2 restart
Then refresh the dvwa page in browser

Upvotes: 0

admin
admin

Reputation: 169

On ubuntu raise same question and I solve it.Just set $_DVWA[ 'db_user' ] = 'root'; $_DVWA[ 'db_password' ] = '';

Upvotes: -2

Uday
Uday

Reputation: 31

Found it for Windows and XAMPP installation. Don't bother to change values in php.ini file located in DVWA Folder. Instead, look for php.ini located in XAMPP installation directory e.g. C:\xampp\php\php.ini

Search for the string:

allow_url_include=

Change the value to allow_url_include=On and restart apache.

Upvotes: 3

manali pawar
manali pawar

Reputation: 81

To solve the issue, go to:

C:\xampp\php\php.ini

And change:

allow_url_include=Off

To:

allow_url_include=On

Then go to:

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

And change:

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

Into:

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

Upvotes: 8

Petr Javorik
Petr Javorik

Reputation: 1863

For Kali Linux editing "apache2 wide" php.ini worked for me:

# 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, search for allow_url_include, set it On

# service restart apache2

And you should have allow_url_include enabled

allow_url_include

Upvotes: 3

Wolfxana
Wolfxana

Reputation: 11

Found the problems mates but this for windows but may apply for you 👍

you need to apply the changes in the "phpForApache.ini" not the "php.in"

Upvotes: 1

Chad D
Chad D

Reputation: 319

I know this is two weeks old at this point but to fix this you will want to modify php.ini, at least on Linux. I haven't ran into this on Windows, but here is the line you need to change:

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

Change that last line to:

allow_url_include=on

Now, restart the Apache server and reload the URL.

Upvotes: 4

Related Questions