Chefelf.com Night Life: Loading PHP Files - Chefelf.com Night Life

Jump to content

Page 1 of 1

Loading PHP Files

#1 User is offline   Chyld Icon

  • Ancient Monstrosity
  • PipPipPipPipPipPipPipPipPip
  • Group: Crappy News Team
  • Posts: 5,770
  • Joined: 04-March 04
  • Gender:Male
  • Location:Not Alaska
  • Country:United Kingdom

Posted 18 February 2008 - 11:54 AM

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?
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
0

#2 User is offline   Radu094 Icon

  • Mini Boss
  • PipPip
  • Group: Junior Members
  • Posts: 192
  • Joined: 02-February 04
  • Location:Romania
  • Country:Nothing Selected

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 ?
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.
0

#3 User is offline   Ninja Duck Icon

  • Cheer up, emo duck.
  • PipPipPipPipPip
  • Group: Moderators
  • Posts: 1,912
  • Joined: 30-October 03
  • Gender:Male
  • Location:Thrillsville
  • Country:United States

Posted 18 February 2008 - 01:50 PM

I remember doing this. You have to have something that looks like a webserver on your computer. In a fit of rage fueled by loathing for Microsoft, I used Apache instead of IIS.
0

#4 User is offline   Radu094 Icon

  • Mini Boss
  • PipPip
  • Group: Junior Members
  • Posts: 192
  • Joined: 02-February 04
  • Location:Romania
  • Country:Nothing Selected

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.
0

#5 User is offline   Chyld Icon

  • Ancient Monstrosity
  • PipPipPipPipPipPipPipPipPip
  • Group: Crappy News Team
  • Posts: 5,770
  • Joined: 04-March 04
  • Gender:Male
  • Location:Not Alaska
  • Country:United Kingdom

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
0

#6 User is offline   Ninja Duck Icon

  • Cheer up, emo duck.
  • PipPipPipPipPip
  • Group: Moderators
  • Posts: 1,912
  • Joined: 30-October 03
  • Gender:Male
  • Location:Thrillsville
  • Country:United States

Posted 25 February 2008 - 01:39 PM

Thanks for informing me about PHP triad. This computer doesn't have PHP on it and I haven't been looking forward to installing it again.
0

#7 User is offline   Heccubus Icon

  • Ugh.
  • PipPipPipPipPipPipPipPip
  • Group: Head Moderator
  • Posts: 4,954
  • Joined: 30-October 03
  • Gender:Male
  • Country:Canada

Posted 09 March 2008 - 06:02 AM

I have never had to do any of that to view PHP files in a web browser.
0

Page 1 of 1


Fast Reply

  • Decrease editor size
  • Increase editor size