skip to Main Content

I’m have a laravel5.5 project up on shared hosting and trying to run cron job to execute the command “schedule:run” but it just won’t execute I think I’m writing the command wrong:

/usr/local/bin/php home/schoolco/prototype/artisan schedule:run >> /dev/null 2>&1

where prototype in the name of my laravel project.
the command works in this directory using ssh.
please if you have any observation or thought share it.

3

Answers


  1. Try like this

    /usr/local/bin/php /home/schoolco/prototype/artisan schedule:run > /dev/null 2>&1
    

    And check are you calling right php executable in your terminal with:

    $ which php
    

    Maybe it is not /usr/local/bin/php , maybe /usr/bin/php

    Login or Signup to reply.
  2. I solved the issue by specifying the php version in the command line:

    * * * * * /usr/local/bin/ea-php71 /home/nemanu/root1/artisan schedule:run >> /dev/null 2>&1
    
    Login or Signup to reply.
  3. If your Project is in Root Directory

    cd /home/cpanel/public_html && /usr/local/bin/ea-php72 artisan schedule:run >> /dev/null 2>&1
    

    If your Project in a folder within Public_Html then use below

     cd /home/cpanel/public_html/folder_name && /usr/local/bin/ea-php72 artisan schedule:run >> /dev/null 2>&1
    

    Hope it will work for you. Thanks

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search