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
 [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

Add a Patch

Pull Requests

Add a Pull Request

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 Apr 19 20:01:29 2024 UTC