简体   繁体   中英

codeigniter cron job not routing to specified controller

I am using cron job in CI but instead of redirecting to cron controller(schedular) the cron job is redirecting to default controller(content). Following are the code:

routes.php
$route['schedular'] = "schedular/index/$1";
$route['(:any)'] = "content/index/$1";

cpanel cron code
/opt/php54/bin/php /home/server_name/public_html/demo/cron.php schedular index

What am I doing wrong? Any help/suggestions are welcome. Thanks in advance.

Yeah, solved the problem as suggested by @Viral. Following is cron command.

/opt/php54/bin/php /home/server_name/public_html/demo/index.php schedular

尝试将您的 cron 任务指向控制器及其要直接运行的功能,而不是从其他任何地方重定向

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM