我是Laravel的新手.我试图打开http://localhost/test/public/,我得到了
异常处理程序出错.
我用Google搜索并更改了存储目录的权限,chmod -R 777 app/storage但无济于事.
我改变debug=>true了app.php并访问了页面并在异常处理程序中得到了错误:
无法打开流或文件"/var/www/html/test/app/storage/logs/laravel.log":无法打开流:/ var/www/html/test/bootstrap/compiled中的权限被拒绝. PHP:8423
然后我使用该命令更改了存储目录的权限,chmod -R 644 app/storage并且"异常处理程序中的错误"错误消失了并且加载了一个页面.但在那里我得到了这个:
file_put_contents(/var/www/html/laravel/app/storage/meta/services.json):无法打开流:权限被拒绝
即使我为存储中的文件夹提供了 777 和所需的用户和组,我也遇到了会话问题。
Filesystem.php 第 81 行中的 ErrorException:file_put_contents(/var/www/html/business/storage/framework/sessions/2b184c1b05d6d2af943d9a4e48875301321a56ec):无法打开流:权限被拒绝
我怎样才能摆脱这个问题?
在 HandleExceptions->handleError('2', 'file_put_contents(/var/www/html/business/storage/framework/sessions/2b184c1b05d6d2af943d9a4e48875301321a56ec): 无法打开流: Permission var denied/www/html/business供应商/laravel/framework/src/Illuminate/Filesystem/Filesystem.php', '81', array('path' => '/var/www/html/business/storage/framework/sessions/2b184c1b05d6d2af943d9a4e48875301321a56ec', => 'a:5:{s:6:"_token";s:40:"Dyi8ML8zxaQJOEiVvqBpqk3noLDJTkIdqiC67qs9";s:9:"_previous";a:1:{s:3:"url";s:29:" http://XXXXX:8333 ";}s:22:"PHPDEBUGBAR_STACK_DATA";a:0:{}s:9:"_sf2_meta";a:3:{s:1:"u";i:1470895812;s :1:"c";i:1470895812;s:1:"l";s:1:"0";}s:5:"flash";a:2:{s:3:"old";a:0:{}s:3:"new";a:0:{}}} ', '锁' => 真))
我从 bitbuket 克隆了一个 Laravel 项目。还运行所有必要的命令来获取所有供应商文件,例如:
composer dump-autoload
composer install
php artisan cache:clear
php artisan clear-compiled
Run Code Online (Sandbox Code Playgroud)
还删除了文件 /public_html/bootstrap/cache/config.php
但是当我尝试启动项目时出现以下错误:
file_put_contents(C:\xampp\htdocs\laravelstart\storage\framework/sessions/sRPb1A6BKrshhH8HPAR2fXVEcCH4daYCLxgo4b8M):无法打开流:没有这样的文件或目录