cron命令:
/user/bin/php "/path/Script.php" >> /path/LogFile.html
Run Code Online (Sandbox Code Playgroud)
当php输出到我的日志文件时,总是说
X-Powered-By: PHP/5.3.22 Content-type: text/html
Run Code Online (Sandbox Code Playgroud)
所以对于我的输出文件,它看起来像:
X-Powered-By: PHP/5.3.22 Content-type: text/html X-Powered-By: PHP/5.3.22 Content-type: text/html X-Powered-By: PHP/5.3.22 Content-type: text/html X-Powered-By: PHP/5.3.22 Content-type: text/html
NEW DAY MARKER | 29/04/2013 00:00:07
Total Exchanges: 73294
Total GMT references: 7
Exchanges pending approval: 4
Run Code Online (Sandbox Code Playgroud)
输出为表格格式,导致重复的text / html标头淹没我的日志文件的前4到5页-因为它们之间
</tr> X-Powered-By: text/html <tr>
Run Code Online (Sandbox Code Playgroud)
标签。
无论如何,我可以告诉它在运行cron作业时不要输出这种标题信息吗?(我不想全局禁用它-需要Web界面才能与其他PHP脚本一起使用)
linux主机,cpanel,vps
/user/bin/php -q "/path/Script.php" >> /path/LogFile.html
Run Code Online (Sandbox Code Playgroud)
该-q开关将在安静模式下,这将禁用头输出运行它
PHP命令行帮助更多的开关