Redirect PHP-Shell-Script output

Posted by Corelgott on Stack Overflow See other posts from Stack Overflow or by Corelgott
Published on 2010-06-12T15:04:04Z Indexed on 2010/06/12 15:12 UTC
Read the original article Hit count: 291

Filed under:
|
|
|

Hi Folks,

i have got a php-script foo.php

#!/usr/bin/php -c /etc/php5/cli/php.ini -q
<?php
  echo 'hello'; // & do some stuff
?>

I call this script not wrapped by a sh-script but using it directly in a cron job. To get rid of it's output i normally would just create a sh-file which calls

/usr/bin/php -c /etc/php5/cli/php.ini -q foo.php > /dev/null 2 > /dev/null 

now i'd like to do this in the interpreter-declaration of the php file it self... so i am looking for the syntax for:

#!/usr/bin/php -args [file's content] > /redirect 2 > /redirect

i have kind of a hard time googleing for it... so if anybody could point me into the right direction i would really appreciate it!

Thx in advance

Corelgott

© Stack Overflow or respective owner

Related posts about php

Related posts about bash