linuxlaravelsupervisord

How can i run php /dirpath/to/artisan artisan list


Not any output when run php /home/directory ... cmd

I try run supervisor run conf with this command:

php /home/example artisan queue:work

and after run supervisor, my jobs dosent dispach and my worker log is empty.

I got to linux shell and run this command:

php /home/example artisan queue:work 

but that command dosnt work and I dont recevie any output.

Then i try to run this:

cd /home/example and then 
php artisan queue:work 

and then that work successfully and show to me:

info processing jobs from the [default] queue

Guys how can i fix that?


Solution

  • The problem is that you're not really targeting artisan.

    artisan is a file, so a proper command would look like this:

    php /home/example/artisan {whatever artisan command you want to run}
    

    That being said, your supervisord configuration should probably mimic the example from the documentation:

    [program:laravel-worker]
    process_name=%(program_name)s_%(process_num)02d
    command=php /home/example/artisan queue:work sqs --sleep=3 --tries=3 --max-time=3600
    autostart=true
    autorestart=true
    stopasgroup=true
    killasgroup=true
    user=forge
    numprocs=8
    redirect_stderr=true
    stdout_logfile=/home/forge/app.com/worker.log
    stopwaitsecs=3600