Windows cannot open this file: index.php

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Windows cannot open this file: index.php

Postby oculus » 11. May 2009 10:32

Hi,

I think I need somebody's help on this matter. I've been creating Web sites using HTML and I encountered no problem in viewing them on my browsers (IE, Firefox, Chrome). I tried using XAMPP just awhile ago and clicked C:\xampp\htdocs\index.php. However, the browser asked me to save the file. My query is that, how do I view these .php files?

Response is highly appreciated!
Thank you,
Oculus
oculus
 
Posts: 18
Joined: 11. May 2009 10:16

Re: Windows cannot open this file: index.php

Postby Nobbie » 11. May 2009 10:36

>My query is that, how do I view these .php files?

http://127.0.0.1/index.php
Nobbie
 
Posts: 8772
Joined: 09. March 2008 13:04

Re: Windows cannot open this file: index.php

Postby Sharley » 11. May 2009 10:39

You can't open a php file like you would in explorer in your browser you need to use a URI like http://localhost/index.php so the web server will parse the code.

If you want to open a php file for editing then drag the file into your open text editor or associate .php files with your text editor etc.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Windows cannot open this file: index.php

Postby oculus » 11. May 2009 10:46

Wow! Thanks for the speedy response!

Okay, this is it: I created a page with "hello.php" filename using notepad. I'm using Windows XP SP2, btw. I saved it to C:\xampp\htdocs\new folder. But when I tried accessing it; typing http://localhost/hello.php or C:\xampp\htdocs\new\hello.php, the browser (Firefox 3) suddenly asks me to save the file. Why is it happening?
oculus
 
Posts: 18
Joined: 11. May 2009 10:16

Re: Windows cannot open this file: index.php

Postby Wiedmann » 11. May 2009 10:49

"hello.php" ... saved it to C:\xampp\htdocs\new folder. But when I tried accessing it; typing http://localhost/hello.php

http://localhost/new/hello.php
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Windows cannot open this file: index.php

Postby oculus » 11. May 2009 10:54

BINGO!!!

From the Land of where intelligence exists,

A MAGNANIMOUS GRATITUDE TO WIEDMANN! A+ from Harvard! LOL

Signed,
The Young Savant (LOL)


Thank you thank you!!!
oculus
 
Posts: 18
Joined: 11. May 2009 10:16


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 54 guests