本人在进行某小程序的后台开发
开发环境为:阿里云centOs7.0+lnmp1.5+thinkphp5.0
结果在设置定时任务时候抓瞎了,看了很多博客,设置定时任务都没有反应
后来才知道,在centOS7.0下,crontab的命令与之前并不相同
CentOS5下crontab的命令
开启
/sbin/service crond start
停止
/sbin/service crond stop
重启
/sbin/service crond restart
重载
/sbin/service crond reload
状态
/sbin/service crond status
CentOS7下crontab的命令
开启
/bin/systemctl start crond.service
停止
/bin/systemctl stop crond.service
重启
/bin/systemctl restart crond.service
重载
/bin/systemctl reload crond.service
状态
/bin/systemctl status crond.service
并且在centOS5下crontab是有返回服务信息的
centOS7下crontab除了status命令,其他命令都不返回任何信息
用了新的命令之后,发现定时任务还是无法执行,马上进行测试
cd /usr/bin (该路径下的php只是一个快捷方式.真正的php文件在/usr/local/php/bin/php)
php /项目路径/index.php /index/index/index
才看到报错
index.php下找不到start.php
<