Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

GodziLaravel's avatar

queue email in shared hosting

Hello ,

I host my project in one shared hosting (inmotion hosting) and I would like to send Emails with queue using database driver but it's not working .

my question :

is it possible to to that with shared hosting ?

if yes : what cron jobs command should I put ?

the actual is :

php -q /home/test/test_com/artisan schedule:run 1>> /dev/null 2>&1
0 likes
6 replies
Cronix's avatar

I host my project in one shared hosting (inmotion hosting) and I would like to send Emails with queue using database driver but it's not working .

Is it possible you're confusing a scheduled job with a queue worker? Have you started the queue? php artisan queue:work https://laravel.com/docs/5.7/queues#running-the-queue-worker

is it possible to to that with shared hosting ?

That depends on the host. Do they allow ssh access?

GodziLaravel's avatar

@cronix Yes I have the SSH and when I run :

php -q /home/test/test_com/artisan queue:work

it returns :

Parse error: syntax error, unexpected '?', expecting variable (T_VARIABLE) in /home/coorza5/coorza_com/vendor/symfony/console/Output/Output.php on line 40
Cronix's avatar

That could be due to a php version issue. Check php -v from console on your host and see if it meets the minimum php version requirements for the version of Laravel you're using. The webserver could be running a different version of php than the cli version.

GodziLaravel's avatar
GodziLaravel
OP
Best Answer
Level 8

@cronix The php version on the terminal is 7.0 but on the project is 7.1 unfortunately they can't change it (terminal) because it's a shared hosting

GodziLaravel's avatar

I found it and it works ,

I changed the php version used on the teminal by changing the path to the 7.1 php version in : .bashrc file

then I ran the php artisan queue:work command

and here is the result :

$ php -q /home/coorza5/coorza_com/artisan queue:work
[2018-11-12 15:20:54][1] Processing: App\Mail\siteMail
[2018-11-12 15:21:08][1] Processed:  App\Mail\siteMail
[2018-11-12 15:21:08][2] Processing: App\Mail\siteMail
[2018-11-12 15:21:17][2] Processed:  App\Mail\siteMail
[2018-11-12 15:21:17][3] Processing: App\Mail\siteMail
[2018-11-12 15:21:26][3] Processed:  App\Mail\siteMail
[2018-11-12 15:21:26][4] Processing: App\Mail\siteMail
[2018-11-12 15:21:33][4] Processed:  App\Mail\siteMail
[2018-11-12 15:24:25][5] Processing: App\Mail\siteMail
[2018-11-12 15:24:35][5] Processed:  App\Mail\siteMail

thank @

Please or to participate in this conversation.