|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21297 CGI/CLI '#!php' handler doesn't skip LF if CR present
Submitted: 2002-12-30 14:36 UTC Modified: 2003-01-07 18:45 UTC
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: benjamin at rqdq dot com Assigned:
Status: Closed Package: *General Issues
PHP Version: 4CVS-2002-12-30 (dev) OS: Any
Private report: No CVE-ID:
 [2002-12-30 14:36 UTC] benjamin at rqdq dot com
  a real simple one...

  in the cli sapi (checked latest in cvs) will check the first byte for '#' to see if it should skip past a script parser line... it will skip until it reaches CR or LF, but if it hits CR, the LF is left as the first byte to be executed by the engine, so the script produces output. 


  #!c:\php4\php-cli.exe -c c:\php4\ [CR] [LF]

  will produce output - the LF.

  mostly a windows issue, but since i send code back and forth from unix & windows machines, sometimes i may have cr/lf in them - and it this would break there as well.



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-01-07 18:45 UTC]
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at
In case this was a documentation problem, the fix will show up soon at

In case this was a website problem, the change will show
up on the site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2015 The PHP Group
All rights reserved.
Last updated: Sat Nov 28 07:01:37 2015 UTC