Laravel Storage Delete / Clean在生产服务器上不起作用

时间:2018-09-13 04:26:41

标签: php laravel cron filesystems storage

我们有Cron清除文件夹中的文件/删除存储中的目录。以下所有内容均无效(没有错误发生。好像没有错误通过一样)。但是神奇的是在本地工作。当我在生产服务器中使用SUDO php artisan cms:clear_bill运行cron时,它正在工作。如何在没有sudo的情况下运行它?

我已经检查过user_bill权限的文件夹是755,并且其中的所有文件都是644。.

$file = new Filesystem();
$file->deleteDirectory(storage_path('app/public/user_bill'));
$file->cleanDirectory(storage_path('app/public/user_bill'));
Storage::deleteDirectory(storage_path('app/public/user_bill'));

我想念任何步骤吗?


已解决

Dammit权限.. cron不在项目用户的权限下运行。

0 个答案:

没有答案