OK, here's a cunning teaser for you bods who know HTML.
I'm once again doing web design for my extended family, once again I'm coding the site in PHP, and once again, when I try loading the pages I've made to see how they look, it tries downloading the PHP file rather than opening it.
This only ever happens when tis saved on my computer, as PHP files work perfectly fine when they're already on the internet, and its not just a Firefox bug, since my copy of IE (chained up in the corner in a gimp suit) is doing it too. Does Nightlife have any thoughts?
Page 1 of 1
Loading PHP Files
#1
Posted 18 February 2008 - 11:54 AM
When you lose your calm, you feed your anger.
Less Is More v4
Now resigned to a readership of me, my cat and some fish
Less Is More v4
Now resigned to a readership of me, my cat and some fish
#2
Posted 18 February 2008 - 01:04 PM
Hmm...well, it makes some sense. The PHP script needs to be interpreted before being served as HTML.
Let me see if I can remember all this :
1. You need to install IIS (comes on the windows XP or Vista DVD) , then do this
2. Even then it will not work if you simply open the .php file in IE by double-clicking on it (this means IE reads the content directly from the disk).
3. You need to setup the IIS to create a virtual website at the location where you have your .php files, then open the browser to
http:\\localhost\nameofthesite\nameofthefile.php
This makes the request go to the IIS server who in turns will pass the request to the PHP interpreter who will respond with HTML.. which will be displayed on your browser rather than downloaded as a content file.
Does it work ?
Let me see if I can remember all this :
1. You need to install IIS (comes on the windows XP or Vista DVD) , then do this
2. Even then it will not work if you simply open the .php file in IE by double-clicking on it (this means IE reads the content directly from the disk).
3. You need to setup the IIS to create a virtual website at the location where you have your .php files, then open the browser to
http:\\localhost\nameofthesite\nameofthefile.php
This makes the request go to the IIS server who in turns will pass the request to the PHP interpreter who will respond with HTML.. which will be displayed on your browser rather than downloaded as a content file.
Does it work ?
I know that you believe you understood what you think I said, but I'm not sure you realize that what you read is not what I meant.
#4
Posted 20 February 2008 - 11:47 AM
Yes, an Apache for windows will also do the trick, but it's usually more dificult to configure. I guess it depends on what you are used to.
If you do choose to go down the Apache route, look for something called PHP triad (search for a latest release). It will automatically install Apache + PHP + MySQL on your windows computer.
I know that you believe you understood what you think I said, but I'm not sure you realize that what you read is not what I meant.
#5
Posted 25 February 2008 - 11:23 AM
Hmm, that's annoying, its a bit more complicated than I thought it'd be. Ah well, its just a few Include tags I've got to run, I'll preview them in HTML until I gets them hosted. Thanks giys!
When you lose your calm, you feed your anger.
Less Is More v4
Now resigned to a readership of me, my cat and some fish
Less Is More v4
Now resigned to a readership of me, my cat and some fish
Page 1 of 1