首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在xampp中安装DVWA时出错

在xampp中安装DVWA时出错
EN

Stack Overflow用户
提问于 2016-01-09 05:16:51
回答 1查看 7.1K关注 0票数 0

当我尝试打开localhost/dvwa时,我得到的结果是:

代码语言:javascript
复制
Fatal error: Uncaught Error: Call to undefined function mysql_connect() in C:\xampp\htdocs\dvwa\dvwa\includes\dvwaPage.inc.php:461 Stack trace: #0 C:\xampp\htdocs\dvwa\login.php(8): dvwaDatabaseConnect() #1 {main} thrown in C:\xampp\htdocs\dvwa\dvwa\includes\dvwaPage.inc.php on line 461

如果我转到localhost/dvwa/setup.php,我将进入数据库设置,但当我单击Create/Reset database时,我会得到如下信息

代码语言:javascript
复制
Fatal error: Uncaught Error: Call to undefined function mysql_connect() in C:\xampp\htdocs\dvwa\dvwa\includes\DBMS\MySQL.php:9 Stack trace: #0 C:\xampp\htdocs\dvwa\setup.php(17): include_once() #1 {main} thrown in C:\xampp\htdocs\dvwa\dvwa\includes\DBMS\MySQL.php on line 9 

我已经更改了$_DVWA 'db_password‘= '';我的config.inc.php如下所示

代码语言:javascript
复制
<?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';

?>
EN

回答 1

Stack Overflow用户

发布于 2016-01-09 07:20:47

您必须在php.ini中启用MySQL扩展。检查PHP documentation

您必须取消注释行,它在php.ini中包含extension=php_mysql.dll (适用于Windows上的PHP )或extension=mysql.so (适用于Linux上的PHP )。如果您正在使用PHP与web服务器,不要忘记重新启动后,在php.ini的任何变化。

在Linux上,您可能需要先安装扩展:

代码语言:javascript
复制
sudo apt-get install php5-mysql

安装还应该自动启用该扩展,这样您就不必在php.ini中启用它。安装后重新启动web服务器。

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

https://stackoverflow.com/questions/34686201

复制
相关文章

相似问题

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