php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13729 PHP Outputs #! line
Submitted: 2001-10-18 05:00 UTC Modified: 2002-04-10 18:46 UTC
From: mc at mcslp dot com Assigned:
Status: Closed Package: *General Issues
PHP Version: 4.0.6 OS: Any
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mc at mcslp dot com
New email:
PHP Version: OS:

 

 [2001-10-18 05:00 UTC] mc at mcslp dot com
When running PHP either as a CGI or through mod_php, 
including the #! line causes it to be included in the 
output. When running as CGI this trips up the browser, when 
running through mod_php it just appears as an additional 
part of the display HTML document. 

The check is in the source code, but it's ignored. The 
patch to fix is:

*** sapi/cgi/cgi_main.c Thu Oct 18 07:01:34 2001
--- sapi/cgi/cgi_main.c.orig    Thu Oct 18 06:19:44 2001
***************
*** 699,706 ****
                        return FAILURE;
                }
                file_handle.filename = argv0;
!       }
!       if (file_handle.handle.fp && 
file_handle.handle.fp!=stdin) {
                /* #!php support */
                c = fgetc(file_handle.handle.fp);
                if (c == '#') {
--- 699,705 ----
                        return FAILURE;
                }
                file_handle.filename = argv0;
!       } else if (file_handle.handle.fp && 
file_handle.handle.fp!=stdin) 
{
                /* #!php support */
                c = fgetc(file_handle.handle.fp);
                if (c == '#') {


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-10-18 21:04 UTC] sniper@php.net
Duplicate of #9041

 [2002-04-10 18:46 UTC] sniper@php.net
the patch was applied to CVS a while ago.

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 22:01:33 2025 UTC