Skip to main content

Overview

This page covers the most common issues encountered when setting up and running DVWA, including 404 errors, blank screens, and log file locations.
For video troubleshooting, watch Fixing DVWA Setup Issues.

Common Problems

Understanding File Locations

By default, the Apache document root (the place it starts looking for web content) is /var/www/html.Example: If you put the file hello.txt in this directory, to access it you would browse to http://localhost/hello.txt.If you created a directory and put the file in there - /var/www/html/mydir/hello.txt - you would then need to browse to http://localhost/mydir/hello.txt.

Case Sensitivity

Linux is by default case sensitive. If you created /var/www/html/mydir/hello.txt, the following URLs would all result in 404 Not Found:
  • http://localhost/MyDir/hello.txt
  • http://localhost/mydir/Hello.txt
  • http://localhost/MYDIR/hello.txt

How This Affects DVWA

Most people use git to clone DVWA into /var/www/html, which gives them the directory /var/www/html/DVWA/ with all the DVWA files inside it. They then browse to http://localhost/ and get either a 404 or the default Apache welcome page.Solution: As the files are in DVWA, you must browse to http://localhost/DVWA.
The common mistake is browsing to http://localhost/dvwa which will give a 404 because dvwa is not DVWA as far as Linux directory matching is concerned.
Key takeaway: After setup, if you try to visit the site and get a 404, think about:
  • Where you installed the files
  • Where they are relative to the document root
  • What the case of the directory you used is
Video Help

The Problem

This is usually one configuration issue hiding another issue. By default, PHP does not display errors, and so if you forgot to turn error display on during the setup process, any other problems (such as failure to connect to the database) will stop the app from loading but the message to tell you what is wrong will be hidden.

The Solution

Make sure you set display_errors and display_startup_errors in your PHP configuration and then restart Apache.PHP Configuration File Locations:
  • /etc/php/x.x/fpm/php.ini
  • /etc/php/x.x/apache2/php.ini
Required Settings:
display_errors = on
display_startup_errors = on
```bash

**Restart Apache:**
```bash
sudo apachectl restart
Video Help

Linux Log Locations

On Linux systems, Apache generates two log files by default:
  • access.log
  • error.log
On Debian based systems, these are usually found in /var/log/apache2/.

Viewing Recent Logs

When submitting error reports or troubleshooting, include at least the last five lines from each log file:
tail -n 5 /var/log/apache2/access.log /var/log/apache2/error.log
```bash

### What to Include in Bug Reports

Please submit at least the following information:
- Operating System
- The last 5 lines from the web server error log directly after whatever error you are reporting occurs
- If it is a database authentication problem, go through the troubleshooting steps and screenshot each step
- A full description of what is going wrong, what you expect to happen, and what you have tried to do to fix it

<Warning>
"login broken" is not enough for us to understand your problem and to help fix it.
</Warning>
</Accordion>

<Accordion title="Configuration file issues">
### Creating the Config File

DVWA ships with a dummy copy of its config file which you will need to copy into place and then make the appropriate changes.

**On Linux:**
```bash
cp config/config.inc.php.dist config/config.inc.php
On Windows: This can be harder if you are hiding file extensions. See How to Make Windows Show File Extensions.

Verify Your Configuration

If you receive an error while trying to create your database, make sure your database credentials are correct within ./config/config.inc.php. This differs from config.inc.php.dist, which is an example file.

Getting More Help

For the latest troubleshooting information, read both open and closed tickets in the GitHub repository: https://github.com/digininja/DVWA/issues
Before submitting a ticket, please make sure you are running the latest version of the code from the repo. This is not the latest release, this is the latest code from the master branch.

Build docs developers (and LLMs) love