Class Not Found Calling a Laravel Script from Supervisord

I'm using Laravel workers to execute some background tasks. When I invoke the worker using 'php artisan queue:work', it works without any problem

But when I add the same command to supervisord in CentOS, using the following congifuration:


process_name=%(program_name)s_%(process_num)02d command=php

/var/www/html/laravel/artisan queue:work autostart=true

autorestart=true user=root numprocs=8 redirect_stderr=true


The jobs are not executed complaining that SoapClient is not found (although it is installed). The SoapClient class is inherited by a plain PHP class that I load externally.

Note that I can use this class via the controller or the jobs when executed from command line without any problem, only in supervisord it's giving me the error message. To make things more weird, it happens only with one job that utilizes this external class, it doesn't happen with jobs that utilize Laravel's classes (controllers, events, etc...) only.

  • 3 months ago

I could solve it by specifying the exact path of the php binary I still don't understand why it didn't pick the default one