'Laravel - Task Scheduling(The system cannot find the path specified.)
When I run :
php /path/to/artisan schedule:run 1>> NUL 2>&1
It gives me an error
The system cannot find the path specified.
The tutorial says that /path/to/artisan is where your project folder is located. My project folder is located in
C:/xampp/htdocs/project/
But when I run :
php C:/xampp/htdocs/project/ schedule:run 1>> NUL 2>&1
or
php C:/xampp/htdocs/project/artisan schedule:run 1>> NUL 2>&1
It gives me the same error
Solution 1:[1]
try this:
php C:/xampp/htdocs/project/artisan schedule:run 1>> /dev/null 2>&1
Solution 2:[2]
/dev/null directory doesn't exist in windows, hence, this error comes out.
You can try this temporary solution just to get rid of the error.
Look for \vendor\laravel\framework\src\Illuminate\Console\Scheduling\Event.php file and scroll to line 83. Change the $output = /dev/null to $output = 'NUL 2>&1'. Then run the cron again.
I hope someone finds this helpful. Happy coding!
Solution 3:[3]
mainly this comes when you try laravel jobs testing in your local. first, deploy code in live and try again.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | ssuhat |
| Solution 2 | Wreeecks |
| Solution 3 | Harsukh Makwana |
