SQL注入平台(sqli-labs)搭建提示Fatal error: Uncaught Error:

笔者搭建该平台时用的是phpstudy,估计wampserver和xmapp也适用

  1. 搭建过程中出现错误

在浏览器进入sqli-labs时有以下提示

Fatal error:  Uncaught Error: Call to undefined function mysql_connect() in E:\phpstudy\PHPTutorial\WWW\sqli-labs-master\sql-connections\sql-connect.php:6Stack trace:#0 E:\phpstudy\PHPTutorial\WWW\sqli-labs-master\Less-1\index.php(15): include()#1 {main}thrown in E:\phpstudy\PHPTutorial\WWW\sqli-labs-master\sql-connections\sql-connect.php on line 6

 

        2.解决方法

这个问题是PHP版本不兼容的缘故,可以通过把PHP版本换到5.x版本解决。

因为PHP5.x版本时,php连接Mysql数据库会使用mysql_connect()连接,PHP7.x版本连接数据库会使用mysqli_connect()连接,而GitHub上的源码最近更新已经是五年前了,所以对PHP高版本会出现不兼容的情况。

猜你喜欢

转载自www.cnblogs.com/impulse-/p/12383234.html