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高版本會出現不兼容的情況。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM