php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #17898 PHP path shown on browser
Submitted: 2002-06-21 10:40 UTC Modified: 2002-06-21 12:13 UTC
From: tyknight at writeme dot com Assigned:
Status: Not a bug Package: Output Control
PHP Version: 4.2.0 OS: Linux 2.4.17
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: tyknight at writeme dot com
New email:
PHP Version: OS:

 

 [2002-06-21 10:40 UTC] tyknight at writeme dot com
i run php as a CGI binary. I found that if i use "require" to import another php file, "#!/usr/local/bin/php" appears in the browser.



For example :
Case I
----------------------------
#!/usr/local/bin/php
<?
     print "Hello World";
?>
-----------------------------
It works fine.


 
Case II
---- index.php ------------------
#!/usr/local/bin/php
<?php
    echo "Hello World!";
    require("config.php");
    echo "Hello World?";
?>
----- config.php ---------------------
#!/usr/local/bin/php
<?php
   echo "In configure file";
   .....
?>
-----------------------------------
The result is

Hello World!
#!/usr/local/bin/php  
In configure file
Hello World?

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-21 12:13 UTC] sander@php.net
Of coures it does! How should it know to ignore the #! line? It's just normal code. The CGI and CLI will ignore the first line of your script if you start it directly.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 02:01:29 2024 UTC