PHP path shows on web page when script is executed

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • kerri.cahoy@gmail.com

    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

  • Andy Hassall

    #2
    Re: PHP path shows on web page when script is executed

    On 18 Feb 2005 10:49:34 -0800, kerri.cahoy@gma il.com wrote:
    [color=blue]
    >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?[/color]

    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.andyhsoftwa re.co.uk/space> Space: disk usage analysis tool

    Comment

    • kerri.cahoy@gmail.com

      #3
      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.

      Comment

      • Geoff Berrow

        #4
        Re: PHP path shows on web page when script is executed

        I noticed that Message-ID:
        <1108771828.162 780.255080@f14g 2000cwb.googleg roups.com> from
        kerri.cahoy@gma il.com contained the following:
        [color=blue]
        >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.[/color]

        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/

        Comment

        • Chung Leong

          #5
          Re: PHP path shows on web page when script is executed


          <kerri.cahoy@gm ail.com> wrote in message
          news:1108771828 .162780.255080@ f14g2000cwb.goo glegroups.com.. .[color=blue]
          > 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.
          >[/color]

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


          Comment

          • Michael Fesser

            #6
            Re: PHP path shows on web page when script is executed

            .oO(Andy Hassall)
            [color=blue]
            >On 18 Feb 2005 10:49:34 -0800, kerri.cahoy@gma il.com wrote:
            >[color=green]
            >>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 ...
            >>[...][/color]
            >
            >You only require that line if you're running PHP as CGI.[/color]

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

            Micha

            Comment

            Working...