PHP path shows on web page when script is executed

This is a discussion on PHP path shows on web page when script is executed within the PHP Language forums, part of the PHP Programming Forums category; Hi all, So this is an aesthetic question, the code all works, thank goodness. The issue is that whenever I ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-18-2005
kerri.cahoy@gmail.com
 
Posts: n/a
Default PHP path shows on web page when script is executed

Hi all,

So this is an aesthetic question, the code all works, thank goodness.

The issue is that whenever I call/execute my php scripts, which all
require the path as the first line, i.e., #!/usr/pubsw/bin/php ... and
I want to know why that line shows up on the web browser?! (None of the
other code shows, except for whatever other html things that are
supposed to show).

My "workaround" at the moment is to have <body text="FFFFFF"> which
makes it white like the background, but there's gotta be a reason for
this, right? :-) Any ideas?

Thanks,

Kerri

Reply With Quote
  #2 (permalink)  
Old 02-18-2005
Andy Hassall
 
Posts: n/a
Default Re: PHP path shows on web page when script is executed

On 18 Feb 2005 10:49:34 -0800, kerri.cahoy@gmail.com wrote:

>So this is an aesthetic question, the code all works, thank goodness.
>
>The issue is that whenever I call/execute my php scripts, which all
>require the path as the first line, i.e., #!/usr/pubsw/bin/php ... and
>I want to know why that line shows up on the web browser?! (None of the
>other code shows, except for whatever other html things that are
>supposed to show).
>
>My "workaround" at the moment is to have <body text="FFFFFF"> which
>makes it white like the background, but there's gotta be a reason for
>this, right? :-) Any ideas?


You only require that line if you're running PHP as CGI. If it's showing,
you're not running as CGI, you're probably running as an Apache module, in
which case you should remove that line.

--
Andy Hassall / <andy@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Reply With Quote
  #3 (permalink)  
Old 02-19-2005
kerri.cahoy@gmail.com
 
Posts: n/a
Default Re: PHP path shows on web page when script is executed

Nope, doesn't work if you remove the path... that was one of the first
things I tried... I wish it were a server I was admin on, I'm putting
this stuff through a cgi-bin on a university's server to run, and Lord
knows what they have set up.

Reply With Quote
  #4 (permalink)  
Old 02-19-2005
Geoff Berrow
 
Posts: n/a
Default Re: PHP path shows on web page when script is executed

I noticed that Message-ID:
<1108771828.162780.255080@f14g2000cwb.googlegroups .com> from
kerri.cahoy@gmail.com contained the following:

>Nope, doesn't work if you remove the path... that was one of the first
>things I tried... I wish it were a server I was admin on, I'm putting
>this stuff through a cgi-bin on a university's server to run, and Lord
>knows what they have set up.


I never used PHP in this mode but I was just wondering if it still works
if you comment it out?

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Reply With Quote
  #5 (permalink)  
Old 02-19-2005
Chung Leong
 
Posts: n/a
Default Re: PHP path shows on web page when script is executed


<kerri.cahoy@gmail.com> wrote in message
news:1108771828.162780.255080@f14g2000cwb.googlegr oups.com...
> Nope, doesn't work if you remove the path... that was one of the first
> things I tried... I wish it were a server I was admin on, I'm putting
> this stuff through a cgi-bin on a university's server to run, and Lord
> knows what they have set up.
>


Try putting a ob_end_clean(); at the beginning of the script.


Reply With Quote
  #6 (permalink)  
Old 02-20-2005
Michael Fesser
 
Posts: n/a
Default Re: PHP path shows on web page when script is executed

.oO(Andy Hassall)

>On 18 Feb 2005 10:49:34 -0800, kerri.cahoy@gmail.com wrote:
>
>>The issue is that whenever I call/execute my php scripts, which all
>>require the path as the first line, i.e., #!/usr/pubsw/bin/php ...
>>[...]

>
>You only require that line if you're running PHP as CGI.


Depends on server configuration. On my systems it's not needed.

Micha
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 10:47 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0