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
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: 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: Thu Dec 26 15:01:32 2024 UTC