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

nomi's avatar
Level 1

Cron Jon on Shared Hosting

Can somebody help me in setting up the Cron job on shared hosting? Below is the command that i am using

* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1

i am using shared hosting By that I mean I have my public folder in public_html / my-folder and the rest of the Laravel app folders in the root directory Can somebody please explain how should I edit my command so it points out rightly

0 likes
1 reply
MarianoMoreyra's avatar

Hi @nomi

It will depend on your hosting, but most of the times the path to your root folder is /home/USERNAME/ so your cron should be something like:

* * * * * cd /home/USERNAME && php artisan schedule:run >> /dev/null 2>&1

Anyway, if you have ssh you can find out the right path running a pwd while inside the root folder of your project.

Hope this helps

Please or to participate in this conversation.