Browser tries to download PHP

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

Browser tries to download PHP

Postby northstarfalling » 20. October 2008 17:49

OS:Windows XP Pro

Apache and PHP Installed by XAMPP v1.6.8

I just started using Apache as my localhost to make changes to my website before I make the changes for real. I am new to using a localhost at all.

Here is the problem. I made a PHP test file (just the normal php info test) I placed the file in C:\xampp\htdocs and ran it in Firefox with the URL: http://localhost/phptest.php this works fine.

Then I tried placing it in a folder and ran it
http://localhost/test/phptest.php
Also fine.

Then I tried placing the test file in my website folder
C:\xampp\htdocs\website
and ran it as http://localhost/website/phptest.php

At this point Firefox wants to download the test file, any ideas on what would be making it do that?

The website is my company's and I was not employed when it was created, so I am not super familiar with what all is there.

Thanks

AH
northstarfalling
 
Posts: 1
Joined: 20. October 2008 17:27

Postby Wiedmann » 20. October 2008 17:57

Then I tried placing the test file in my website folder
C:\xampp\htdocs\website

At this point Firefox wants to download the test file, any ideas on what would be making it do that?

The website is my company's and I was not employed when it was created,

There are other files in "C:\xampp\htdocs\website" (e.g. a ".htaccess")?
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby Sho-Down » 23. October 2008 06:55

Wiedmann wrote:
There are other files in "C:\xampp\htdocs\website" (e.g. a ".htaccess")?


I'm not the original poster (didn't want to make a new post) but maybe you can help me, I'm having the exact problem as him and yes, there is a .htaccess file and a .htaccess.addHandlerBak file in my folder.

Here's a screen shot of the files/folders inside of my folder: http://img505.imageshack.us/my.php?image=ssuz2.jpg

I tried the "test.php" method he did and it worked for me too, the test.php file came up fine in a folder by itself, but when I try to go to http://localhost/wplocal Firefox pops up a download box asking me if I want to Open or Save the file. Same thing happens if I go to http://localhost/

So it's a file inside wplocal that's causing the problem, can you tell me what file it is and how to fix it?
Sho-Down
 
Posts: 3
Joined: 23. October 2008 06:33

Postby Wiedmann » 23. October 2008 07:31

there is a .htaccess file and a .htaccess.addHandlerBak file in my folder.

The file ".htaccess" can cause this problem. Remove this file temporarily and try again.
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby Sho-Down » 23. October 2008 08:52

Thanks, that worked :)

This is for a Wordpress blog, I'm trying to clone it basically on my localhost. I can see my site now but only the "Home" link is working correctly. In phpmyadmin I changed the siteurl and home in wp_options, but the menu links are linking back to my .com site and the links that do have the right url (ie: http://localhost/wplocal/category/club/) go to an Object not found! page.

Anything I'm missing here?

Could it be the Wordpress plugins or something causing the problem?
Sho-Down
 
Posts: 3
Joined: 23. October 2008 06:33

Postby Wiedmann » 23. October 2008 09:00

but the menu links are linking back to my .com site

I guess there is now something wrong with the setup of this software.

and the links that do have the right url (ie: http://localhost/wplocal/category/club/) go to an Object not found! page.

I guess this software needs a ".htaccess" because of mod_rewrite (you must enable mod_rewrite in httpd.conf). But some entries in your "htaccess" are only for a specific (your ISPs) server.

[quote]Could it be the Wordpress plugins or something causing the problem?[/quot]
A Wordpress support forum would be the better place for such questions. (I don't know anything about this software and it's configuration)
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby Sho-Down » 23. October 2008 09:05

I guess this software needs a ".htaccess" because of mod_rewrite (you must enable mod_rewrite in httpd.conf). But some entries in your "htaccess" are only for a specific (your ISPs) server.


I think you're right. The wordpress site needs the .htaccess for permalinks, that's why my links aren't working.

I'm a total noob when it comes to this, how do I enable mod_rewrite in httpd.conf? What program does that?
Sho-Down
 
Posts: 3
Joined: 23. October 2008 06:33

Postby Wiedmann » 23. October 2008 09:23

how do I enable mod_rewrite in httpd.conf?

Remove the "#" sign from the line "LoadModule rewrite_module ...".
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 132 guests