环境centos 7.0
nginx: 1.12.2
php: 7.1.12
访问间的路径是
1 | http://centos7.com/php/blog/server.php |
报错信息是:
1 | file_put_contents(/vagrant/php/blog/storage/framework/views/7fb79758ff256713f26e772997799b4741bdee06.php): failed to open stream: Permission denied |
在此之前报错
1 | The stream or file "/vagrant/php/blog/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied |
,手动新建了文件
1 | laravel.log |
并给予了777权限。
最后文件
1 | laravel.log |
里面的内容是
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | [2017-12-04 11:45:40] local.ERROR: file_put_contents(/vagrant/php/blog/storage/framework/views/7fb79758ff256713f26e772997799b4741bdee06.php): failed to open stream: Permission denied {"exception":"[object] (ErrorException(code: 0): file_put_contents(/vagrant/php/blog/storage/framework/views/7fb79758ff256713f26e772997799b4741bdee06.php): failed to open stream: Permission denied at /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:122) [stacktrace] #0 [internal function]: Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleError(2, 'file_put_conten...', '/vagrant/php/bl...', 122, Array) #1 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(122): file_put_contents('/vagrant/php/bl...', '...', 0) #2 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/View/Compilers/BladeCompiler.php(121): Illuminate\\Filesystem\\Filesystem->put('/vagrant/php/bl...', '...') #3 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php(51): Illuminate\\View\\Compilers\\BladeCompiler->compile('/vagrant/php/bl...') #4 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/View/View.php(137): Illuminate\\View\\Engines\\CompilerEngine->get('/vagrant/php/bl...', Array) #5 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/View/View.php(120): Illuminate\\View\\View->getContents() #6 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/View/View.php(85): Illuminate\\View\\View->renderContents() #7 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Http/Response.php(42): Illuminate\\View\\View->render() #8 /vagrant/php/blog/vendor/symfony/http-foundation/Response.php(200): Illuminate\\Http\\Response->setContent(Object(Illuminate\\View\\View)) #9 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Routing/Router.php(724): Symfony\\Component\\HttpFoundation\\Response->__construct(Object(Illuminate\\View\\View)) #10 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Routing/Router.php(698): Illuminate\\Routing\\Router::toResponse(Object(Illuminate\\Http\\Request), Object(Illuminate\\View\\View)) #11 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Routing/Router.php(658): Illuminate\\Routing\\Router->prepareResponse(Object(Illuminate\\Http\\Request), Object(Illuminate\\View\\View)) #12 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(30): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request)) #13 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(41): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request)) #14 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #15 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #16 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(67): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request)) #17 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #18 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #19 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request)) #20 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #21 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #22 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(63): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request)) #23 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Illuminate\\Session\\Middleware\\StartSession->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #24 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #25 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/COOKIE/Middleware/AddQueuedCOOKIEsToResponse.php(37): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request)) #26 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Illuminate\\COOKIE\\Middleware\\AddQueuedCOOKIEsToResponse->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #27 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #28 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/COOKIE/Middleware/EncryptCOOKIEs.php(59): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request)) #29 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Illuminate\\COOKIE\\Middleware\\EncryptCOOKIEs->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #30 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #31 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request)) #32 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Routing/Router.php(660): Illuminate\\Pipeline\\Pipeline->then(Object(Closure)) #33 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Routing/Router.php(635): Illuminate\\Routing\\Router->runRouteWithinStack(Object(Illuminate\\Routing\\Route), Object(Illuminate\\Http\\Request)) #34 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Routing/Router.php(601): Illuminate\\Routing\\Router->runRoute(Object(Illuminate\\Http\\Request), Object(Illuminate\\Routing\\Route)) #35 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Routing/Router.php(590): Illuminate\\Routing\\Router->dispatchToRoute(Object(Illuminate\\Http\\Request)) #36 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(176): Illuminate\\Routing\\Router->dispatch(Object(Illuminate\\Http\\Request)) #37 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(30): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}(Object(Illuminate\\Http\\Request)) #38 /vagrant/php/blog/vendor/fideloper/proxy/src/TrustProxies.php(56): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request)) #39 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Fideloper\\Proxy\\TrustProxies->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #40 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #41 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(30): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request)) #42 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #43 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #44 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(30): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request)) #45 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #46 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #47 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request)) #48 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #49 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #50 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(46): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request)) #51 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Illuminate\\Foundation\\Http\\Middleware\\CheckForMaintenanceMode->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #52 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #53 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request)) #54 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(151): Illuminate\\Pipeline\\Pipeline->then(Object(Closure)) #55 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(116): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter(Object(Illuminate\\Http\\Request)) #56 /vagrant/php/blog/public/index.php(55): Illuminate\\Foundation\\Http\\Kernel->handle(Object(Illuminate\\Http\\Request)) #57 /vagrant/php/blog/server.php(21): require_once('/vagrant/php/bl...') #58 {main} "} [2017-12-04 11:45:41] local.ERROR: file_put_contents(/vagrant/php/blog/storage/framework/sessions/pDxhcLk25Q40b6qY1WRy3GLejRvIM1COWU4oy1gX): failed to open stream: Permission denied {"exception":"[object] (ErrorException(code: 0): file_put_contents(/vagrant/php/blog/storage/framework/sessions/pDxhcLk25Q40b6qY1WRy3GLejRvIM1COWU4oy1gX): failed to open stream: Permission denied at /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:122) [stacktrace] #0 [internal function]: Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleError(2, 'file_put_conten...', '/vagrant/php/bl...', 122, Array) #1 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(122): file_put_contents('/vagrant/php/bl...', 'a:3:{s:6:"_toke...', 2) #2 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Session/FileSessionHandler.php(83): Illuminate\\Filesystem\\Filesystem->put('/vagrant/php/bl...', 'a:3:{s:6:"_toke...', true) #3 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Session/Store.php(128): Illuminate\\Session\\FileSessionHandler->write('pDxhcLk25Q40b6q...', 'a:3:{s:6:"_toke...') #4 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(87): Illuminate\\Session\\Store->save() #5 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(218): Illuminate\\Session\\Middleware\\StartSession->terminate(Object(Illuminate\\Http\\Request), Object(Illuminate\\Http\\Response)) #6 /vagrant/php/blog/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(189): Illuminate\\Foundation\\Http\\Kernel->terminateMiddleware(Object(Illuminate\\Http\\Request), Object(Illuminate\\Http\\Response)) #7 /vagrant/php/blog/public/index.php(60): Illuminate\\Foundation\\Http\\Kernel->terminate(Object(Illuminate\\Http\\Request), Object(Illuminate\\Http\\Response)) #8 /vagrant/php/blog/server.php(21): require_once('/vagrant/php/bl...') #9 {main} "} |