Reputation: 139
cron command:
/user/bin/php "/path/Script.php" >> /path/LogFile.html
when php outputs to my log file, it always starts off by saying
X-Powered-By: PHP/5.3.22 Content-type: text/html
so with my output file, it looks something like:
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
the output is in a table format, causing the the repeated text/html header to flood the first 4 or 5 pages of my log file - because they are between
</tr> X-Powered-By: text/html <tr>
tags.
is there anyway i can tell it not to put out that kind of header information when running cron jobs? (i don't want to disable it globaly - need web interface to still work with other PHP scripts)
linux host, cpanel, vps
Upvotes: 5
Views: 1145
Reputation: 426
/user/bin/php -q "/path/Script.php" >> /path/LogFile.html
the -q
switch will run it in quiet mode which will disable header output
php command line help for more switches
Upvotes: 5