DVWA Fatal error: Call to undefined function fnmatch()错误解决方法

最近在学习dvwa,学到文件包含(file inclusion)时,我将安全等级调为高,再进入文件包含(file inclusion)页面时,出现了下列错误提示

Fatal error: Call to undefined function fnmatch() in C:\phpStudyB\WWW\vulnerabilities\fi\source\high.php on line 8

解决方法:

按照错误提示,打开C:\phpStudyB\WWW\vulnerabilities\fi\source\high.php,添加下列语句

if(!function_exists('fnmatch')) {
     
   function fnmatch($pattern, $string) {
     
     return preg_match("#^".strtr(preg_quote($pattern, '#'),array('\*' => '.*', '\?'=> '.'))."$#i", $string); 
     } // end
} // end if

改为之后大概是这样
DVWA Fatal error: Call to undefined function fnmatch()错误解决方法_第1张图片

你可能感兴趣的:(网络安全,php)