gpt4 book ai didi

php - file_put_contents(meta/services.json) : failed to open stream: Permission denied

转载 作者:IT老高 更新时间:2023-10-28 11:42:53 35 4
gpt4 key购买 nike

我是 Laravel 的新手。我试图打开 http://localhost/test/public/ 我得到了

Error in exception handler.

我用谷歌搜索并使用 chmod -R 777 app/storage 更改了存储目录的权限,但无济于事。

我在 app.php 中更改了 debug=>true 并访问该页面并在异常处理程序中得到错误:

The stream or file "/var/www/html/test/app/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied in /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): failed to open stream: Permission denied

最佳答案

vsmoraes 的建议对我有用:

Laravel >= 5.4

php artisan cache:clear 
chmod -R 775 storage/
composer dump-autoload

Laravel < 5.4

php artisan cache:clear 
chmod -R 775 app/storage
composer dump-autoload

关于php - file_put_contents(meta/services.json) : failed to open stream: Permission denied,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23540083/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com