473,748 Members | 10,649 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
Jul 17 '05 #1
3 8818

On 20-Nov-2003, Aardwolf <aa********@spa mless.hotmail.c om> 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*********@wil lglen.net (it's reserved for spammers)
Jul 17 '05 #2
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.ev il.ones.will.bo w-down-to.us
(put "Hey!" in the Subject line for priority processing!)
-- http://www.pixelsaredead.com
Jul 17 '05 #3
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*********@mm ers.and.evil.on es.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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
4104
by: CJM | last post by:
I have an ASP page that lists files and folders in a directory. I'm using a cookie to record the last time this page was visited, and I intend to show links that are created/modified from that date minus 30mins to the present... eg effectively new and modified files: If DateDiff("n", subfolder.DateLastModified, sLastVisit ) < 30 Then.... etc On my test machine this mechanism works OK, but on the live server (Win2k, IIS5) I get some...
5
569
by: fripper | last post by:
I posted this problem a couple of days ago but felt I might have better luck re-stating the problem. Apparently I messed up IIS (v. 5) somehow because I am suddenly unable to load web forms! A simple example will help. I created a simple web project that contains two simple forms ... WebForm1 and WebForm2. WebForm1 has a button which when clicked simply does a Response.Redirect("WebForm2.aspx"). When I run the program and click the...
9
3509
by: Jason Blair | last post by:
I recently upgraded my server from win2k to win2k3. I cannot run asp pages now. If the asp page is configured as part of an application i get "The requested resource is in use" If I remove the application i get the error "HTTP/1.1 New Application Failed" . I made sure ASP was enabled but I still can't seem to figure out what the problem is. Any Ideas?
7
2311
by: Adam Short | last post by:
I'm having all sorts of problems with Sessions, I've been using them for years with out a hitch, all of a sudden the last 6 - 12 months since getting our new Win2003 server it's all gone shakey!!! Our development server started life as an NT4 machine and has been simply upgraded from one operating system to the next, it is now a cross, NT4 Server, Win2000 Server, Win2003 server. All development sites work fine and under heavy stress. ...
3
1215
by: Jorge Castro | last post by:
Hi I am a newcommer to .NET. I am interested in both .NET and also in ASP.NET. I read in the .NET SDK release notes that as a pre- condition you have to have IIS pre-installed on your machine. However, I could not find a free download for IIS. On the other hand ASP.NET download seems to include the
8
3397
by: nick | last post by:
I have a problem and I've been using a cheezy work around and was wondering if anyone else out there has a better solution. The problem: Let's say I have a web application appA. Locally, I set it up as C:\domains\appA. Locally, my IIS root points to C:\domains. I don't point it to C:\domains\appA since if I have an appB under C:\domains I wouldn't be able to get to it. So to access it via my browser I go to localhost/appA.
16
7366
by: Bob Moore | last post by:
We have a requirement to put a client onto machines intended for some telephony work. The database access will be via ASP.Net pages, and that's fine, but the telephony stuff requires access to some legacy servers. I've prototyped the client itself as Winforms/C# (which was NOT fun for a C++ curmudgeon like me, but I'll live). The problem is, I'd like to be able to ensure that the user is always running the latest client (our current fat...
4
2383
by: musosdev | last post by:
Hi peeps I've just moved my dev system to Win2k3 / VS2005 (from Win2k/VS2k3) and I'm having a problem. I've setup a new website in IIS, enabled .net, fpse, etc. From VS2005, if I choose Open Website, I can type in the location of my server by entering http://10.0.0.253:4040. That works fine, and VS loads the project.
2
5325
by: scott mcfadden | last post by:
Using VS 2003, I can not add a web reference to our production server's ..asmx URL using HTTPS. I will put in a URL like: https://mycompany.com/myapp/myservice.asmx VStudio will display the web methods from that URL and when I click on OK to download/build the dynamic web proxy code, I get the following error: Unable to download files from http://mycompany.com/myapp/myservice.asmx
0
8830
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9541
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9370
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9247
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8242
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6796
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6074
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4602
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4874
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.