Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
358 views
in Technique[技术] by (71.8m points)

php - 在xampp中安装DVWA时出错(Error installing DVWA in xampp)

When i try to open localhost/dvwa i get this:

(当我尝试打开localhost / dvwa时,我得到了:)

Fatal error: Uncaught Error: Call to undefined function mysql_connect() in C:xampphtdocsdvwadvwaincludesdvwaPage.inc.php:461 Stack trace: #0 C:xampphtdocsdvwalogin.php(8): dvwaDatabaseConnect() #1 {main} thrown in C:xampphtdocsdvwadvwaincludesdvwaPage.inc.php on line 461

and if i go to localhost/dvwa/setup.php i get to the database setup but when i click Create/Reset Database i get this

(如果我去localhost / dvwa / setup.php我进入数据库设置,但是当我单击Create / Reset Database时我得到了)

Fatal error: Uncaught Error: Call to undefined function mysql_connect() in C:xampphtdocsdvwadvwaincludesDBMSMySQL.php:9 Stack trace: #0 C:xampphtdocsdvwasetup.php(17): include_once() #1 {main} thrown in C:xampphtdocsdvwadvwaincludesDBMSMySQL.php on line 9 

i already change $_DVWA[ 'db_password' ] = '';

(我已经更改了$ _DVWA ['db_password'] ='';)

and my config.inc.php looks like this

(和我的config.inc.php看起来像这样)

<?php

# If you are having problems connecting to the MySQL database and all of the variables below are correct
# try changing the 'db_server' variable from localhost to 127.0.0.1. Fixes a problem due to sockets.
#   Thanks to @digininja for the fix.

# Database management system to use
$DBMS = 'MySQL';
#$DBMS = 'PGSQL'; // Currently disabled

# Database variables
#   WARNING: The database specified under db_database WILL BE ENTIRELY DELETED during setup.
#   Please use a database dedicated to DVWA.
$_DVWA = array();
$_DVWA[ 'db_server' ]   = '127.0.0.1';
$_DVWA[ 'db_database' ] = 'dvwa';
$_DVWA[ 'db_user' ]     = 'root';
$_DVWA[ 'db_password' ] = '';

# Only used with PostgreSQL/PGSQL database selection.
$_DVWA[ 'db_port '] = '5432';

# ReCAPTCHA settings
#   Used for the 'Insecure CAPTCHA' module
#   You'll need to generate your own keys at: https://www.google.com/recaptcha/admin/create
$_DVWA[ 'recaptcha_public_key' ]  = '';
$_DVWA[ 'recaptcha_private_key' ] = '';

# Default security level
#   Default value for the secuirty level with each session.
#   The default is 'impossible'. You may wish to set this to either 'low', 'medium', 'high' or impossible'.
$_DVWA[ 'default_security_level' ] = 'impossible';

# Default PHPIDS status
#   PHPIDS status with each session.
#   The default is 'disabled'. You can set this to be either 'enabled' or 'disabled'.
$_DVWA[ 'default_phpids_level' ] = 'disabled';

# Verbose PHPIDS messages
#   Enabling this will show why the WAF blocked the request on the blocked request.
#   The default is 'disabled'. You can set this to be either 'true' or 'false'.
$_DVWA[ 'default_phpids_verbose' ] = 'false';

?>
  ask by JosecitoBaneador translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You have to enable the MySQL extension in php.ini .

(您必须在php.ini启用MySQL扩展。)

Check PHP documentation .

(检查PHP文档 。)

You have to uncomment line, which contains extension=php_mysql.dll (for PHP on Windows) or extension=mysql.so (for PHP on Linux) in your php.ini .

(你必须取消注释行,其中包含extension=php_mysql.dll (Windows上的PHP)或extension=mysql.so (对于PHP在Linux上)在你php.ini 。)

If you're using PHP with a web server, don't forget to restart it after any change in php.ini .

(如果将PHP与Web服务器一起使用,请不要忘记在php.ini进行任何更改后重新启动它。)

It's possible that on Linux you will have to install the extension first:

(在Linux上,您可能必须首先安装扩展:)

sudo apt-get install php5-mysql

Installation should also enable the extension automatically, so you don't have to enable it the php.ini .

(安装还应该自动启用该扩展,因此您不必启用php.ini 。)

Restart the web server after installation.

(安装后重新启动Web服务器。)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...