php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13737 #!/usr/local/bin/php shell script line is shown first at the result page
Submitted: 2001-10-18 10:39 UTC Modified: 2002-02-09 19:49 UTC
From: pgalan at cscamaras dot es Assigned:
Status: Closed Package: *General Issues
PHP Version: 4.0.5 OS: Solaris 2.6
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: pgalan at cscamaras dot es
New email:
PHP Version: OS:

 

 [2001-10-18 10:39 UTC] pgalan at cscamaras dot es
If I run the following example:

#!/usr/local/bin/php
<?
        print "<br>Hello Word";
?>

I got the following result page:

#!/usr/local/bin/php
Hello World 

The configure options are:

./configure --with-config-file-path=/usr/local/lib --disable-debug --enable-ftp --with-informix=$INFORMIXDIR  --enable-t
rans-sid  --with-pgsql=/usr/local/pgsql --with-mysql

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-10-18 21:27 UTC] sniper@php.net
Duplicate of #9041
 [2001-10-19 02:07 UTC] pgalan at cscamaras dot es
I have solved it by making the changes recomended in bug id 9040.

Locate the $PHP_INSTALL_PATH/sapi/cgi/cgi_main.c and make the following changes:

*** sapi/cgi/cgi_main.c.origSun Dec  3 02:09:13 2000
--- sapi/cgi/cgi_main.cWed Jan 24 16:39:34 2001
            ***************
            *** 719,725 ****
              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 == '#') {
            --- 719,726 ----
              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 == '#') {
 [2002-02-09 19:49 UTC] mfischer@php.net
This bug has been fixed in CVS.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Mar 12 11:01:32 2025 UTC