How could I stop PHP from returning headers when executed from commandline?

Posted by JonnyLitt on Stack Overflow See other posts from Stack Overflow or by JonnyLitt
Published on 2010-03-14T20:09:23Z Indexed on 2010/03/14 20:15 UTC
Read the original article Hit count: 269

Filed under:
|
|
|
|

This may be a ridiculous question, but it's been bothering me for a while. I have a mail forwarder piped to a PHP script, it receives perfectly, however I have the following error mailed back to me instantly:

A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. The following address(es) failed:

  pipe to |/home/[webroot]/public_html/external/mobile/email.php
    generated by mobile@[mydomain]

The following text was generated during the delivery attempt:

X-Powered-By: PHP/5.2.13 
Content-type: text/html

As you can see, Exim thinks the header response an error from the script I have. The script can receive the Email perfectly from php://stdin but Exim is quick-replying with the error.

Plus,

  • It's running from console, not Apache so HTAccess or configuring Apache most likely would do nothing.
  • I can not find any solution, or anyone with the same problem.

So my question is: How to I get rid of those two headers?

Thanks, ~Jonny

© Stack Overflow or respective owner

Related posts about php

Related posts about commandline