skip to Main Content

In my local system cron job is working perfectly when calling php artisan schedule:run. but when i upload laravel project into my cpanel, the cron job is not working. Below is my cpanel cron job path.

*   *   *   *   *   php -d register_argc_argv=On /home/techworld/public_html/hubli-betting/artisan schedule:run > /dev/null 2>&1

This command generates below mention error in log file.

[2019-12-19 15:15:03] local.ERROR: Invalid argument supplied for foreach() {"exception":"[object] (ErrorException(code: 0): Invalid argument supplied for foreach() at /home/techworld/public_html/hubli-betting/vendor/symfony/console/Input/ArgvInput.php:246)
[stacktrace]
#0 /home/techworld/public_html/hubli-betting/vendor/symfony/console/Input/ArgvInput.php(246): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'Invalid argumen...', '/home/techworld...', 246, Array)
#1 /home/techworld/public_html/hubli-betting/vendor/symfony/console/Application.php(1060): Symfony\Component\Console\Input\ArgvInput->getFirstArgument()
#2 /home/techworld/public_html/hubli-betting/vendor/laravel/framework/src/Illuminate/Console/Application.php(81): Symfony\Component\Console\Application->getCommandName(Object(Symfony\Component\Console\Input\ArgvInput))
#3 /home/techworld/public_html/hubli-betting/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(133): Illuminate\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 /home/techworld/public_html/hubli-betting/artisan(36): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#5 {main}
"}

2

Answers


  1. This works fine in crontab, you can try this:

    $ crontab -e
    

    Then add this line into the file.

    * * * * * cd /var/www/html/YOUR_PROJECT && php artisan schedule:run >> /dev/null 2>&1
    

    Check whether addition was successful using:

    $ crontab -l
    
    Login or Signup to reply.
  2. Mine is working using the following:

    ***** cd /home/techworld/public_html/hubli-betting && php artisan schedule:run >> /dev/null 2>&1
    

    enter image description here

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