Cannot open .php files

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

Cannot open .php files

Postby bsmith » 23. August 2009 04:13

I have changed my file extensions to .php, but my Vista operating system and my Windows Xp os doesn't recognize the file, nor can I open it. Everything else is fine.
bsmith
 
Posts: 7
Joined: 15. August 2009 21:15

Re: Cannot open .php files

Postby Wiedmann » 23. August 2009 11:21

os doesn't recognize the file, nor can I open it.

Can you exactly explain what you are doing?

(I guess you are not accessing PHP files with a webbrowser through a webserver.)
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Cannot open .php files

Postby bsmith » 23. August 2009 18:20

Wiedmann wrote:
os doesn't recognize the file, nor can I open it.

Can you exactly explain what you are doing?

(I guess you are not accessing PHP files with a webbrowser through a webserver.)

I am putting all my documents that I wish to open (.php or otherwise) in the htdocs folder. I have an index.html file that I can open there, that states "it works" after I go to localhost and open it. I am using IE 7 to do this via the apache web server. But no .php documents can be created or opened. I can rename a .txt document to a .php document, like I did in web dev class, but after I do this, it will not open properly. Thank you for your time!
bsmith
 
Posts: 7
Joined: 15. August 2009 21:15

Re: Cannot open .php files

Postby Wiedmann » 23. August 2009 18:35

I have an index.html file that I can open there, that states "it works" after I go to localhost and open it.

Just to be sure:
You open this file with http://localhost/index.html?
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Cannot open .php files

Postby bsmith » 23. August 2009 23:31

Wiedmann wrote:
I have an index.html file that I can open there, that states "it works" after I go to localhost and open it.

Just to be sure:
You open this file with http://localhost/index.html?

correct
bsmith
 
Posts: 7
Joined: 15. August 2009 21:15

Re: Cannot open .php files

Postby Wiedmann » 24. August 2009 00:51

But no .php documents can be created or opened.

- What's the name for this PHP file?
- In which directory is this file located?
- Which URI are you using to access this file?
- I don't think the error message in your browser is "can't be created or opened". What's the real error message and code?
- What's the corresponding line in the error.log for this access?
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Cannot open .php files

Postby bsmith » 25. August 2009 04:28

Wiedmann wrote:
But no .php documents can be created or opened.

- What's the name for this PHP file? index.php
- In which directory is this file located? the htdocs file
- Which URI are you using to access this file?http://localhost/xampp
- I don't think the error message in your browser is "can't be created or opened". What's the real error message and code?
I doubleclick on the file in windows explorer view and it asks me if I want to open or save. If I click to open this php_auto_save file, it just keeps getting ready to open the browser and then giving me the same message again- "Do you want to open or save this file?" If I open it via localhost/index.php, it goes straight to the xampp page again.
- What's the corresponding line in the error.log for this access? because it is not an error, like you stated- there is no error log
bsmith
 
Posts: 7
Joined: 15. August 2009 21:15

Re: Cannot open .php files

Postby Izzy » 25. August 2009 05:51

You need to associate php files with a program that will read the file and to get you started your text editor will do, notepad perhaps.

1. Open Windows Explorer and go to the C:\xampp\htdocs folder and right click on the index.php file.

2. Now select Properties.

3. Next Look for Opens with: and click on the Change button.

4. Next window click on Select the program from a list.

5. Click OK

6. Next Open With window, look in the list for Notepad and click on it.

7. Now make sure you have a tick in the box next to Always use the selected program to open this kind of file.

8. Click OK, then Apply, then OK.

You should now be able to double click on any .php file and it should open in Notepad for reading and editing.

Of course if you have a php code editor then you would select this from the list instead of notepad.

You know, of course, that to open a php file in a browser you need to specify a URI.

I hope this helps with your problem.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: Cannot open .php files

Postby bsmith » 26. August 2009 20:17

Thank you for helping me.
bsmith
 
Posts: 7
Joined: 15. August 2009 21:15

Re: Cannot open .php files

Postby Izzy » 27. August 2009 01:54

bsmith wrote:Thank you for helping me.
You're very welcome and if there is anything else you are stuck on then it only takes another topic post to hopefully get the answers that will allow you to move on.

Good luck.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 163 guests