Maison >développement back-end >tutoriel php >linux计划任务运行php文件的方法分享_PHP教程
创建计划任务的脚本:
dos2unix /path/to/<span filename.php crontab </span>-<span e </span><span 10</span> <span 6</span> * * * /path/to/filename.php
# chomod +x /path/to/filename.php
<span #</span><span !/usr/bin/php -q </span> <?<span php </span><span //</span><span 写入文件到日志log中</span> <span file_put_contents</span>('/path/to/log', <span date</span>('Y-m-d H:i:s')."\n",<span FILE_APPEND); </span><span //</span><span by www.jbxue.com</span> ?>