linux 定时运行php脚本

1、首先需要在php文件头部加 #!/usr/bin/php -q 

#!/usr/bin/php -q

<?php

/**

 * @author hhb

 * @date:18/6/22

 * @return PDO|string

 */

2、其次使用crontab  -e  添加 定时任务

*/10   *  *  *  *   /usr/bin/php   /home/quzheng/test.php   >>/home/quzheng/test.log  

完成

猜你喜欢

转载自blog.csdn.net/qq_16877261/article/details/81100121