• 安装完 Laravel,运行项目之后,报错:The stream or file "/usr/local/var/laravel-test/dcat/storage/logs/laravel-2021-06-15.log" could not be opened in append mode: failed to open stream: Permission denied

  • 正常安装完 Laravel 后,需要给这两个文件配置读写权限:storage 目录和 bootstrap/cache 目录,我是全部一块加上。

  • 操作流程

    1、进入项目当前文件夹,例如 /project/testtest 是项目文件夹。

    $ cd /project

    2、添加权限

    $ chmod -R 777 test

    附:如果报错 chmod: Unable to change file mode on laravel-test/storage/framework/views/eef325e700d1864421506922200f7548a0f32fd8.php: Operation not permitted,我这里是直接删除了这种文件,一看估计就是个缓存文件,然后重新添加权限

Logo

Agent 垂直技术社区,欢迎活跃、内容共建。

更多推荐