I tried this path but didnt received any output
that because >> /dev/null 2>&1 sends all output to the null device ... so you wont see it.
Leave this off until you know exactly what commands you need
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I tried this path but didnt received any output
that because >> /dev/null 2>&1 sends all output to the null device ... so you wont see it.
Leave this off until you know exactly what commands you need
Then how will I send birthday wishes to the user directly through mail without using crob tab????
you cannot.
You need cron job to run to execute the laravel scheduler ... unless you want to get up every day, connect to your server and run it manually.....
Don't be confused >> /dev/null 2>&1 is stopping you see the console output of commands. It is not stopping the php code from being executed.
On Windows OS there is no crontab. You need to use the scheduler task from Windows to create a "Cronjob". See this for task scheduler. https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/cc721931(v=ws.11)?redirectedfrom=MSDN
Why would you ever need to run crontab on a windows machine?
I tried using your link but i m getting error as (0x80040213)
@krishma - I dont think you need to run the cron tasks on Windows, if your artisan command works, then thats fine. In production or on a centos server, then as long as you setup your cron task correctly to run the artisan command that is required to schedule commands correctly you will be fine.
Trying to setup a scheduler locally to recreate the issue you are having in production where you scheduler command wont work, wont teach you anything. You need to work out why the cron is not firing correctly.
If you want to make sure it is firing, as a \Log::debug('email fired'); message to it, and you will see an entry in the log when it has fired.
Bottom line, if the artisan command works, but the scheduler does not, you have misconfigured your cron command and trying to replicate that locally won't get you anywhere
@snapey his environment is windows and using xampp software. So all the crontab suggestions would not help him.
@ramjithap He stated above he was using a centos server in production:
I am hosting it on centos server I have also added cron job using the below command
cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1.I have assigned the path of my project and after i have tested in localhost by using command
php artisan schedule:run
and I m getting below output
Running scheduled command: "C:\xampp\php\php.exe" "artisan" email:birthday > "NU L" 2>&1
@ramjithap I m getting error as (0x80040213) after trying on schedular tasks from windows to create a cron job
@drewdan do you think this path(C:\xampp\php\php.exe) belongs to CentOS. Its windows path. But this is definitely his fault not mentioning the environment he trying.
Can anyone help me out with this error (0x80040213) which i m getting on schedule tasks on windows
I am not saying anything is his fault. I am saying from what he has described, he has a local server, which is running xampp, and a development server which is running CentOS.
He wants the development server to run the scheduler command so his server sends out and email on schedule. However, in his cron task he used the local path instead. Which is incorrect. So I think he is trying to run the scheduler locally to try and find out whats wrong, but I don't think that will help him.
My point is, if he is trying to run a scheduler locally to work out why his centos one is not working, then it is not going to help him get his centos working as the crontask and the windows scheduler are fundamentally different. Also, I do not ever see a need to run a scheduler locally @snapey said earlier.
I am definitely not trying to assign blame or being unkind.
@krishma - where do you see this error? Can anyone help me out with this error (0x80040213) which i m getting on schedule tasks on windows
@drewdan I have also tried on windows scheduler .Over there i got this error.(0x80040213)
@krishma What email settings do you have in your env file? It looks like the windows scheduler might be suggesting the email could not be sent due to settings being wrong
I have also tried with scheduler which i available on windows...
Steps to get schedule on windows Start->Control Panel->Administrative Tools->Schedule Tasks...
In this I have also tried..I think error is related to SMTP server... So what i have to write in SMTP server??
You can define the settings in your .env file for the SMTP server, what settings are you currently using? Mailgun? SMTP?
I m using SMTP
I have given Mail encryption = TLS Mail_port = 587 remaining i have given mail username and password
And if you run the php artisan command, the email does send with these. Hmm, I am a bit of a loss there
@drewdan What to do now through cron job also i m not able to receive mail and without cron job by using scheduler on windows also i m also not able to receive mail
Paste your entire contents of App\Console\Kernel.php here.
Paste the entire contents of your E-mail Command class (email:birthday) here.
Run on your computer: php artisan email:birthday
Did you receive the e-mail? If not, paste the console output / the last lines of your storage/logs/laravel.log here.
Once you have dealt with that, we can talk about making it work on the CentOS server. But please, do it step by step and methodically so we're able to help.
So all the crontab suggestions would not help him.
neither will suggestions about running scheduled jobs on his development machine.
@guybrush_threepwood This is my app\console\kernel
Without scheduler or cron job is it possible to send direct email by just doing laravel programming??
On your production server...
you need something that will run automatically once a day...
that is called a cronjob...
it works for everyone else...
Please or to participate in this conversation.