I have been trying to set up scheduler as per your instructions with no result.
When I try:
/usr/local/bin/php /home/mysite/public_html/protected/app/start/artisan cron:run it gives error Could not open input file: /home/mysite/public_html/protected/app/start/artisan
/usr/local/bin/php /home/mysite/public_html/protected/app/controllers/TestController.php it gives error Fatal error: Class 'BaseController' not found in
/usr/local/bin/php -q /home/mysite/public_html/protected/app/start/artisan cron:run Error-Could not open input file:
php /var/www/com/mysite.com/artisan cron:run Status: 404 Not Found No input file specified.
/usr/local/bin/php home/opendesk/public_html/protected/app/start/artisan.php and in artisan.php I do like Artisan::add(new CronRunCommand); Error Fatal error: Class 'Artisan' not found
/usr/local/bin/php /home/opendesk/public_html/protected/app/start/artisan.php when in artisan.php I change it to $artisan->add(new CronRunCommand); Error Fatal error: Call to a member function add() on a non-object None of it seems to work. Can you please help
Just in case anyone has the same issue as me.
When I manually ran "php artisan cron:run" I didn't get any message to the screen... however it was working, it just writes message to the log file.... app/storage/logs/laravel.log had the entry.
It isn't specified here but you need to run the command from the root of the laravel installation you are working in.
To get the cron working I had to use this for the command (cd to the root of the laravel installation then call artisan, using the full path to php)
*/5 * * * * cd /usr/home/laravelroot/ && /usr/local/bin/php artisan cron:run
That being said I got it working and I am super thankful, this was WAYYYY easier than doing the upgrade to 5.1 for this app.
Much love to sisou for sharing this
I wrote a new timed function... it runs every 5 minutes between an hour range you pass in.
Add this to the list of functions
protected function everyFiveMinutesFrom($start_hour, $end_hour, callable $callback)
{
if( ((int) date('H', $this->timestamp) >= $start_hour) && ((int) date('H', $this->timestamp) <= $end_hour) && ((int) date('i', $this->timestamp) % 5 === 0) ) call_user_func($callback);
}
and call it like this
$this->everyFiveMinutesFrom('07', '18', function() {
//code
});
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community