ok I found it using some thread I realize I add tospecify the full path of php. Default php version was 4 which is not compatible with laravel...
Specifying the path to php 7 resolve everything !
hope it might help some in the future...
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi all,
I'm on a a shared hosting solution (ovh) and setup a queue which worked fine on local but not on shared. So I tried several solutions :
Artisan::call('queue:work',['--once' => true]);
works but it is synchroneous whereas I would like to run it background.
exec('php artisan view:clear --once > /dev/null 2>&1 & echo $!',$test);
returns error syntax error, unexpected T_FUNCTION in ...
the given line being : $app->bind('path.public', function() { return DIR.'../www/'; });
So when it comes to the cron :
protected function schedule(Schedule $schedule)
{
$schedule->job(new CronHourly)->hourly();
$schedule->exec('php /home/gerantimcm/artisan queue:work --once > /dev/null 2>&1')->hourly();
$this->scheduleRunsHourly($schedule);
}
protected function scheduleRunsHourly(Schedule $schedule)
{
foreach ($schedule->events() as $event) {
$event->expression = substr_replace($event->expression, '*', 0, 1);
}
}
the CronHourly is executed but no mail is sent.
I tried also the following
$schedule->command('queue:work --daemon')->hourly()->withoutOverlapping();
but not working.
Any idea ?
ok I found it using some thread I realize I add tospecify the full path of php. Default php version was 4 which is not compatible with laravel...
Specifying the path to php 7 resolve everything !
hope it might help some in the future...
Please or to participate in this conversation.