Windows not opening .php files via localhost

Hi,
Strange problem happening here.
Working with Windows 7, IE10. Also have FF and other browsers – no problems there. Running WAMP 2.4, PHP5.4.12
My problem is that .php files will not open locally in IE. I get a message from IE about wanting to open or save the file. When I click open, the file opens in Dreamweaver. PHP pages online open just fine – good thing!
I’ve made no changes to anything in the system. Working with DW(CS6) files earlier today, I got a message that there was a sharing violation. I couldn’t save over any files. So I made a new folder within which I can now save.
So the big (among others) thing, is that I cannot test in IE.
Thoughts on what is happening, what could have happened here and how to fix?
Thanks much.
Cheers,

Good morning,

Are you trying to open your files directly into your browser (eg right clicking the file and opening in IE), or are you actually going through localhost to open the file?

Kind regards,

cL.

To clarify CodingLife’s question, are you trying to reach the file by

http://localhost/some/path/to/a/file.php

Or are you using

file://c:/some/path/to/a/file.php

The first example the php should parse and give output. In the second example you will get the behavior you’ve observed. PHP scripts won’t run unless they pass through the webserver or are invoked with the interpreter on the command line.

Hi,
Thank you both for the follow-up.
I tried both the “http://localhost/some/path/to/a/file.php” and the right-click.
In IE, using the localhost method, I get the tab which says “Waiting for localhost” and keeps spinning. The URL path I am using works for FF, Safari and Chrome.
More thoughts???
Thanks,
Cheers,

Install wamp in order to view your php files ya

Good evening,

He’s already got a WAMP server running on his computer.

I had the same problems when first starting out in PHP and it was because I was right clicking and trying to open my PHP files directly into the browser.

If you are going through localhost and still receiving errors, I’m not too sure as to what to do.

Is it loading through localhost or just keeps ‘spinning’? Does the website load when you try in other browsers?

Kind regards,

cL

If you get a message about choosing between opening or saving the file, that implies that the header information coming from the server is incorrect, surely? I can’t look at my wamp server to investigate further as my system tray icon disappears on a seemingly random basis, but that used to be the issue - IE decides how to handle the incoming stream based on the page header.

Hi,
Just a follow-up.
thank you for all the responses.

Is it loading through localhost or just keeps ‘spinning’? Does the website load when you try in other browsers?

It was just spinning and yes, going through localhost. Other browsers did load.
For whatever reason, the spinning problem is cleared up now – not sure what changed. I did a massive clean-up of the machine, likely (?) that made the difference???
Thanks again.
Cheers,