There could be a few reasons why the cron job is not working on the live server. Here are a few things to check:
-
Make sure the path to the PHP binary is correct. On some servers, it may be located at
/usr/bin/phpinstead of/usr/local/bin/php. You can check the correct path by runningwhich phpin the terminal. -
Check the permissions of the
Multi_Vendor_invoicefile. Make sure it is executable by runningchmod +x /home/bigeweb/Multi_Vendor_invoice. -
Check the output of the cron job by redirecting the output to a file instead of
/dev/null. For example, you can change the cron job command to:/usr/local/bin/php /home/bigeweb/Multi_Vendor_invoice && php artisan schedule:run >> /home/bigeweb/cron.log 2>&1This will redirect the output to a file called
cron.login the home directory of thebigewebuser. You can then check the contents of this file to see if there are any errors. -
Make sure the Laravel scheduler is set up correctly. Check that the
schedule:runcommand is working by running it manually in the terminal:php artisan schedule:runThis should trigger any scheduled tasks that are due to run.
-
Check that the email sending code is working correctly. You can test this by running the custom command manually in the terminal:
/usr/local/bin/php /home/bigeweb/Multi_Vendor_invoiceThis should send the emails to the registered accounts.
Once you have checked these things, you should be able to identify the issue and fix the cron job.