Re: PHP path shown on browser

From: Date: Sun, 20 Jan 2002 12:12:46 +0000
Subject: Re: PHP path shown on browser
References: 1  Groups: php.install 
Request: Send a blank email to php-install+get-5632@lists.php.net to get a copy of this message
I have fixed the problem. The problem came out because PHP cannot access php.ini. "#!/usr/local/bin/php" will disappear once PHP can read the doc_root in php.ini. However, i got another problem. If i run a problem that involve many php files, many "#!/usr/local/bin/php" will appear on the browser. If works fine if the program is just a php file. 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? i know the reason. PHP treat "#!/usr/local/bin/php" in config.php as html. Simply remove "#!/usr/local/bin/php" in config.php can fix the problem. However, it is very time-consuming to find out which files should take away the line. Does someone know how to modify the source code so that "#!/usr/local/bin/php" will be ignored or the lines starting with "#" will be treated as commend. If you have no time to tell me the step, just tell me what file I should modify or give me some hints. Thanks "Tony" <tyknight@writeme.com> ¼¶¼g©ó¶l¥ó·s»D :20020119174617.84910.qmail@pb1.pair.com... > Hi all, > > I got a problem when i run php as a CGI binary. > I wrote a php script as follow > > #!/usr/local/bin/php > <? > print "Hello World"; > ?> > > however, i got the following result when i called it from browser > > #!/usr/local/bin/php > Hello World > > The path of PHP is always shown at the top of the browser. > > Does anyone know the solution? > > Thanks > Tony. > > >

« previous php.install (#5632) next »