RouteCollection.php第161行中的NotFoundHttpException:Laravel index.php无法访问

时间:2017-02-18 00:58:16

标签: php .htaccess laravel

我知道有关Laravel这个问题的问题已经很少了。但是,他们都没有解决我的问题。因此,在正确安装了与作曲家的幼虫之后,我在我的htdocs中创建了Laravel项目文件夹。当我启动XAMPP服务器并尝试通过URL

访问它时
http://localhost/Php/myLaravel/public/index

我收到的是空白页或有时我收到以下错误消息。

NotFoundHttpException in RouteCollection.php line 161:
in RouteCollection.php line 161
at RouteCollection->match(object(Request)) in Router.php line 533
at Router->findRoute(object(Request)) in Router.php line 512
at Router->dispatchToRoute(object(Request)) in Router.php line 498
at Router->dispatch(object(Request)) in Kernel.php line 174
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request)) in Pipeline.php line 30 at Pipeline->Illuminate\Routing\{closure}(object(Request)) in TransformsRequest.php line 30
at TransformsRequest->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in TransformsRequest.php line 30
at TransformsRequest->handle(object(Request), object(Closure)) in Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 53

这是全新安装,没有任何改变。这是项目文件夹

中的.htaccess文件
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
    Options -MultiViews
</IfModule>

RewriteEngine On

# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]

# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>

有人可以帮忙吗?谢谢

2 个答案:

答案 0 :(得分:0)

我确实通过将./storage目录上的权限更改为可写来实现它,并且它有效!希望对别人有帮助!

答案 1 :(得分:0)

安装Laravel后,您可能需要配置一些权限。

所以请允许以下两个目录:

storage

bootstrap/cache

它对我有用......

我希望它可以帮助你