By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,731 Members | 1,129 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,731 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a

On 20-Nov-2003, Aardwolf <aa********@spamless.hotmail.com> wrote:
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??


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
www.creative-light.com
tom (at) creative (dash) light (dot) com
do NOT send email to ja*********@willglen.net (it's reserved for spammers)
Jul 17 '05 #2

P: n/a
Regarding this well-known quote, often attributed to Aardwolf's famous
"Thu, 20 Nov 2003 08:36:44 -0700" speech:
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


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.evil.ones.will.bow-down-to.us
(put "Hey!" in the Subject line for priority processing!)
-- http://www.pixelsaredead.com
Jul 17 '05 #3

P: n/a
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
<so*********@mmers.and.evil.ones.will.bow-down-to.us> wrote:
Regarding this well-known quote, often attributed to Aardwolf's famous
"Thu, 20 Nov 2003 08:36:44 -0700" speech:
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


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.


Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.