PROBLEM: My PHP Scripts Try to Download instead of Run Locally (Win2K IIS)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Aardwolf

    PROBLEM: My PHP Scripts Try to Download instead of Run Locally (Win2K IIS)

    I've had PHP on my Win2K server running IIs 5 for about 2 weeks now.
    I have an annoying problem in that I can not run the php
    scripts/pages locally, instead they open up in the browser as a
    download.

    By that I mean that If I access them via my lan or the net from
    another computer on my lan, the webpages that have php on them and end
    in a .php extension all run fine and work just great.

    BUT if I open up the browser on the IIs server and do a file open and
    browse to the php page I want, I get the download file box as the
    computer trys to download the page instead of executing it.

    An alternative method of getting the same error is if I use the
    browser on the server to locally open a web page up with a link to a
    php script/pagepage, I see the web page just as it should appear, but
    as soon as I click on the link to the PHP script/page the same
    download & save thing happens instead of the page just being processes
    normally.

    This is a real pain when I want to just run some scripts locally for
    testing or admin purposes.

    Anybody know why this would be??

    Thanks
    Aardwolf
  • Tom Thackrey

    #2
    Re: PROBLEM: My PHP Scripts Try to Download instead of Run Locally (Win2K IIS)


    On 20-Nov-2003, Aardwolf <aardvark99@spa mless.hotmail.c om> wrote:
    [color=blue]
    > I've had PHP on my Win2K server running IIs 5 for about 2 weeks now.
    > I have an annoying problem in that I can not run the php
    > scripts/pages locally, instead they open up in the browser as a
    > download.
    >
    > By that I mean that If I access them via my lan or the net from
    > another computer on my lan, the webpages that have php on them and end
    > in a .php extension all run fine and work just great.
    >
    > BUT if I open up the browser on the IIs server and do a file open and
    > browse to the php page I want, I get the download file box as the
    > computer trys to download the page instead of executing it.
    >
    > An alternative method of getting the same error is if I use the
    > browser on the server to locally open a web page up with a link to a
    > php script/pagepage, I see the web page just as it should appear, but
    > as soon as I click on the link to the PHP script/page the same
    > download & save thing happens instead of the page just being processes
    > normally.
    >
    > This is a real pain when I want to just run some scripts locally for
    > testing or admin purposes.
    >
    > Anybody know why this would be??[/color]

    When you do a File/Open in the browser or double click on the .php file, you
    are NOT going through the server. You can tell by looking at the address box
    in the browser, it will show a file path instead of a URL.

    --
    Tom Thackrey

    tom (at) creative (dash) light (dot) com
    do NOT send email to jamesbutler@wil lglen.net (it's reserved for spammers)

    Comment

    • FLEB

      #3
      Re: PROBLEM: My PHP Scripts Try to Download instead of Run Locally (Win2K IIS)

      Regarding this well-known quote, often attributed to Aardwolf's famous
      "Thu, 20 Nov 2003 08:36:44 -0700" speech:
      [color=blue]
      > I've had PHP on my Win2K server running IIs 5 for about 2 weeks now.
      > I have an annoying problem in that I can not run the php
      > scripts/pages locally, instead they open up in the browser as a
      > download.
      >
      > By that I mean that If I access them via my lan or the net from
      > another computer on my lan, the webpages that have php on them and end
      > in a .php extension all run fine and work just great.
      >
      > BUT if I open up the browser on the IIs server and do a file open and
      > browse to the php page I want, I get the download file box as the
      > computer trys to download the page instead of executing it.
      >
      > An alternative method of getting the same error is if I use the
      > browser on the server to locally open a web page up with a link to a
      > php script/pagepage, I see the web page just as it should appear, but
      > as soon as I click on the link to the PHP script/page the same
      > download & save thing happens instead of the page just being processes
      > normally.
      >
      > This is a real pain when I want to just run some scripts locally for
      > testing or admin purposes.
      >
      > Anybody know why this would be??
      >
      > Thanks
      > Aardwolf[/color]

      You'll have to call the scripts through the server. The server software is
      the one that understands how to interpret a PHP file and spit out HTML
      code. Running the file locally, your browser doesn't know what the file is.

      If the scripts are in your webspace directories, you can just open
      http://localhost/ (or http://127.0.0.1) to get to your server just as if
      you were coming from outside.

      --
      -- Rudy Fleminger
      -- sp@mmers.and.ev il.ones.will.bo w-down-to.us
      (put "Hey!" in the Subject line for priority processing!)
      -- http://www.pixelsaredead.com

      Comment

      • Aardwolf

        #4
        Re: PROBLEM: My PHP Scripts Try to Download instead of Run Locally (Win2K IIS)

        Thanks for the answers all.

        I was not clear in my original post, but I had also tried to access
        the scripts via both the localhost modes as well, and got the same
        results. After I saw the replys to my post, they cleaered up some
        questions that I had and at that point I figured it had to be an error
        in my IIS installation or something I had done to it. I redid the IIs
        installation and everything is working fine now.

        I do appreciate the help given, & I hope that this may help some
        others.

        Aardwolf


        On Sun, 23 Nov 2003 11:29:55 -0500, FLEB
        <soon.the.sp@mm ers.and.evil.on es.will.bow-down-to.us> wrote:
        [color=blue]
        >Regarding this well-known quote, often attributed to Aardwolf's famous
        >"Thu, 20 Nov 2003 08:36:44 -0700" speech:
        >[color=green]
        >> I've had PHP on my Win2K server running IIs 5 for about 2 weeks now.
        >> I have an annoying problem in that I can not run the php
        >> scripts/pages locally, instead they open up in the browser as a
        >> download.
        >>
        >> By that I mean that If I access them via my lan or the net from
        >> another computer on my lan, the webpages that have php on them and end
        >> in a .php extension all run fine and work just great.
        >>
        >> BUT if I open up the browser on the IIs server and do a file open and
        >> browse to the php page I want, I get the download file box as the
        >> computer trys to download the page instead of executing it.
        >>
        >> An alternative method of getting the same error is if I use the
        >> browser on the server to locally open a web page up with a link to a
        >> php script/pagepage, I see the web page just as it should appear, but
        >> as soon as I click on the link to the PHP script/page the same
        >> download & save thing happens instead of the page just being processes
        >> normally.
        >>
        >> This is a real pain when I want to just run some scripts locally for
        >> testing or admin purposes.
        >>
        >> Anybody know why this would be??
        >>
        >> Thanks
        >> Aardwolf[/color]
        >
        >You'll have to call the scripts through the server. The server software is
        >the one that understands how to interpret a PHP file and spit out HTML
        >code. Running the file locally, your browser doesn't know what the file is.
        >
        >If the scripts are in your webspace directories, you can just open
        >http://localhost/ (or http://127.0.0.1) to get to your server just as if
        >you were coming from outside.[/color]

        Comment

        Working...