您现在的位置:首页 >> 前端 >> 内容

wampserver能启动localhost但不能打开自己的项目如何解决?

时间:2018/3/27 11:14:36 点击:

  核心提示:www目录下找到index.php,修改如下代码:修改前:while (($file = readdir($handle))!==false){if (is_dir($file)!in_array($...

www目录下找到index.php,修改如下代码:

修改前:

while (($file = readdir($handle))!==false)
{
    if (is_dir($file) && !in_array($file,$projectsListIgnore))
    {
        $projectContents .= '<li><a href="';
        if($suppress_localhost)
            $projectContents .= 'https://'.$file.$UrlPort.'/"';  //需要改动的地方
        else
            $projectContents .= 'https://localhost'.$UrlPort.'/'.$file.'/"';
        $projectContents .= '>'.$file.'</a></li>';
    }
}

修改后:

while (($file = readdir($handle))!==false)
{
    if (is_dir($file) && !in_array($file,$projectsListIgnore))
    {
        $projectContents .= '<li><a href="';
        if($suppress_localhost)
            $projectContents .= 'https://localhost/'.$file.$UrlPort.'/"';  //改动后的
        else
            $projectContents .= 'https://localhost/'.$UrlPort.'/'.$file.'/"';
        $projectContents .= '>'.$file.'</a></li>';
    }
}

重新启动wampserver即可打开。

Tags:WA AM MP PS 
作者:网络 来源:the3musket