I use laravel job & queue to defer some tasks in Laravel. What I'm going to do is store the uploaded files on the storage server and then do some processing on them. So I have defined two jobs and I run them in two queues.
The files are stored in the /tmp/ path, but due to the use of php-fpm and nginx, this path is actually /tmp/systemd-private-e8***2-php-fpm.service-3zCfIf/tmp/
Storage::disk('...') is also used to access these files.
Everything works fine when I run the queue worker with the following command
php artisan queue: work database --queue = StoreMedia, ProcessMedia --sleep = 3 --tries = 5
The problem arises when I use Supervisor. In this case, the files are not found ... while they exist ... In this case, the path does not seem to be correct and Storage::disk('...')->exist(...) Returns the false value
The supervisor settings are as follows
[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/html/app/artisan queue:work database --queue=StoreMedia,ProcessMedia --sleep=3 --tries=5
autostart=true
autorestart=true
user=root
numprocs=8
redirect_stderr=true
stdout_logfile= /var/www/html/app/storage/logs/worker.log
stopwaitsecs=3600
How should I use supervisor in this mode? Is Problem with supervisor access permissions to files? I think in this case the path is interpreted as /tmp/x/.mp4 instead of /tmp/systemd-private-e8***2-php-fpm.service-3zCfIf/tmp/x/y.mp4 And that has caused the problem. What is the solution?