开发者

Why do some of my pages return 500s on my XAMPP server?

I cannot figure out what the hell is going on for the life of me.

Normally when I want to run a site 开发者_如何学运维locally for testing purposes, I simply point my browser to:

http://localhost/site_folder

This works on the majority of my pages but for some strange (and I mean really strange) reason, some folders give a 500 redirect error.

I thought perhaps something was wrong with one of my scripts until I created a new folder and a basic php info page:

<?php
phpinfo();
?>

my site comes up with:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, postmaster@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

Apache/2.2.14 (Win32) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l mod_autoindex_color PHP/5.3.1 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1 Server at localhost Port 80

I check my local error logs and get:

Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.

Nothing has changed on my configuration, no .htaccess files to mess with, other folders work. WTF is going on?


I have dealt with this problem before and it was the result of a hidden .htaccess file, I know you said you have checked for one but possibly try checking your htdocs folder because if you documentroot is set to /htdocs in your httpd.conf then any folders inside that will inherit your .htaccess setup.

It's probably not the case but just worth giving it a check anyway.


In my personal experience i find that XAMPP is awful piece of software. I always build my environment from scratch, its not as hard as people think. Its very difficult to diagnose errors with somebody else's setup such as XAMPP.

Most likely this is where your redirect issue comes from. I would check all php keeping note of any redirects and stay away from any code that is run by XAMPP (disabling any pages that come with it).

Hopefully this should help, but my final advice is get rid of it =)


maybe it's too late to answer but the error that happened to me was the following

Rewrite Engine On
RewriteCond % { REQUEST_FILENAME }! -f
RewriteRule ^ ([ ^ \.] + ) $ $1.php[NC, L]
RewriteRule ^ ([ ^ \.] + ) $ $1.html[NC, L]

ErrorDocument 404 http://pagina.com/404
    Error Document 500 http://pagina.com/404

The .htaccess was misconfigured, using VS it throws me it wraps the file with spaces Just remove the .htaccess in test and in production you put it

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜