0
votes

Hello and thanks in advance,

I am using Laravel 5 hosted on Godaddy. I am trying to get a cron job to run but I keep getting this message:

Status: 404 Not Found X-Powered-By: PHP/7.1.11 Content-type: text/html; charset=UTF-8 No input file specified.

I haven't done a cron myself in Laravel before and I decided to follow this tutorial https://scotch.io/@Kidalikevin/how-to-set-up-cron-job-in-laravel

Everything works fine when I run php artisan DeleteInActiveUsers:deleteusers but the Cron doesn't.

Below are the commands I have tried in the Cron, the file name I created based on the tut is called DumpZohoContacts.php.

Note: I have added /usr/bin/php & -q but it still doesn't work I also ran app_path(); to see my app path and check that. And the code is not the issue since it runs fine by itself

Cron Commands:

php /home/[hidden]/public_html/rms/artisan schedule:run

php /home/[hidden]/public_html/artisan schedule:run

php /home/[hidden]/public_html/rms/artisan zohoDumpToDb:dumpContacts

php /home/[hidden]/public_html/artisan zohoDumpToDb:dumpContacts

php /home/[hidden]/public_html/rms/app/Console/Commands/artisan schedule:run

php /home/[hidden]/public_html/rms/app/Console/Commands/artisan zohoDumpToDb:dumpContacts

php /home/[hidden]/public_html/rms/app/Console/Commands/DumpZohoContacts.php

1
i see dozen of dupes, hope you tried them alluser8011997
It should be something like /usr/bin/php /home/username/public_html/artisan schedule:run /dev/null >> 2&1Ohgodwhy
@rtfm > I have tried them all with different combinations.Patrick Florian
@Ohgodwhy Thanks actually your syntax got me further but now I get /bin/bash: 1: command not found im gonna go into the actual commands path and try it out ill let you knowPatrick Florian
Didn't work not sure what im doing wrong if you guys need anything from me code etc let me know thanksPatrick Florian

1 Answers

0
votes

From my Email, I used to get this warning. Iff you have entered an incorrect command

PHP Warning:  Module 'magickwand' already loaded in Unknown on line 0
Status: 404 Not Found
X-Powered-By: PHP/5.6.37
Content-type: text/html; charset=UTF-8

No input file specified.

If you are about to schedule the command as once a day (i.e., 00:00) the same time should be reflected in a $schedule->command(); object

In Kernel.php you should specify

/**
 * Define the application's command schedule.
 *
 * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
 * @return void
 */
protected function schedule(Schedule $schedule)
{
    $schedule->command('SyncAPIOrders:orders')
               ->timezone('Asia/Kolkata')
               ->dailyAt('00:00');
}

You should add the command from the cPanel server as

/usr/local/bin/php /home/xyz/public_html/artisan schedule:run 1>> /home/xyz/public_html/log_laravel 2>&1

This will keep all the logs in /home/xyz/public_html/log_laravel

Running scheduled command: '/opt/cpanel/ea-php71/root/usr/bin/php' 'artisan' SyncAPIOrders:orders > '/dev/null' 2>&1