【问题标题】:What is the right permission for laravel in centos Server?centos Server中laravel的正确权限是什么?
【发布时间】:2020-02-05 03:17:00
【问题描述】:

我已经在 centos 服务器中安装了 laravel,并且我有 Nginx 网络服务器。 所以我以这种方式给予许可:

sudo chown nginx:nginx -R laravel
sudo find /path/to/laravel/root/directory -type f -exec chmod 644 {} \;    
sudo find /path/to/laravel/root/directory -type d -exec chmod 755 {} \;

我有一份工作,应该每晚执行一次。但它说我权限被拒绝 这是它的错误:

ErrorException:file_put_contents(/storage/framework/views/4c5ceab6c4a8a0145f0cbc6ee6ffbfc02a9f53c4.php):无法打开流:/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:122 中的权限被拒绝 堆栈跟踪:


#0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'file_put_conten...', '/var/www/phpadm...', 122, Array)

我该怎么办?

【问题讨论】:

    标签: laravel security centos


    【解决方案1】:

    存储目录的权限需要为 755,确保您使用 -r 标志递归设置权限。

    【讨论】:

      猜你喜欢
      • 2010-10-10
      • 2017-03-10
      • 2016-09-12
      • 1970-01-01
      • 1970-01-01
      • 2015-08-20
      • 2016-05-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多