Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cron php how to stop headers in append to file

Tags:

php

header

cron

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

like image 612
WaxyChicken Avatar asked Apr 29 '13 12:04

WaxyChicken


1 Answers

/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

like image 157
Stephan Avatar answered Oct 20 '22 14:10

Stephan