Localhost error

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

Localhost error

Postby rgwhitaker » 27. August 2011 23:34

I downloaded and installed XAMPP to my local machine. I then downloaded the files I have on my hosting service to my new local machine (other laptop was recently stolen--long story!)

First question: I had set up on my hosting service so that when you try to access my website, which is still in development, you are prompted for a username and password. Now that I downloaded the files to my local machine from the hosting server, when I try to access my website locally, I'm still prompted for a username and password.

How do I get rid of that login prompt when I want to simply check the .php files via XAMPP on my local machine?

Also, when I try to access the index.php file on my local machine, I receive the following error:

Server error!
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.
If you think this is a server error, please contact the webmaster.
Error 500


What would cause that and how can I open my .PHP files locally via XAMPP?

Thank you for any help!
rgwhitaker
 
Posts: 4
Joined: 18. June 2010 18:56

Re: Localhost error

Postby Sharley » 28. August 2011 03:14

In the web root folder you downloaded from your hosting service there will be a .htaccess file that will contain the code that Apache translates into a request for a username and password.

Find this file and delete it or rename it to htaccess.txt or similar.
If it contains other code not related to authentication, then you would need to drag the file into a text editor and delete lines similar to this
Code: Select all
AuthName "xampp user"
AuthType Basic
AuthUserFile "C:\xampp\security\xampp.users"
require valid-user
Your lines will not be identical to this but will be similar - the AuthUserFile refers to the location of the .htpasswd file mentioned below.

There may also be a .htpasswd file (AuthUserFile) associated with the .htaccess file that stores the encrypted password and if you find this file then you will also need to rename or delete it.

Now try again to access your web site through localhost.


Look in the \xampp\apache\logs\error.log file for clues about the 500 error.

The 500 error may be caused by an incorrect shebang (the first line of a perl script) and from your hosting service it would look similar to this
Code: Select all
"#!/usr/bin/perl"
But in an XAMPP perl script the shebang should point to your XAMPP perl executable, for example in a default installation the location would be
Code: Select all
#!"C:\xampp\perl\bin\perl.exe"
You would need to open each script in your cgi-bin folder or where ever your perl scripts are stored and change the top line to reflect the perl.exe location of XAMPP - you can see an example, that should have the correct shebang, by checking in the example scripts found in the \xampp\cgi-bin folder.

The real clues to the 500 error will be found in the error.log file.
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: Localhost error

Postby rgwhitaker » 28. August 2011 03:21

That worked. Thank you!

I simply renamed the .htaccess file to .oldhtaccess and it worked.

Thanks!
rgwhitaker
 
Posts: 4
Joined: 18. June 2010 18:56


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 53 guests