This problem happen when i change IIS to apache on windows server 2003.
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.
let me share the way how i fixed this,hope this can help you.
Introduce
I have a php which work with win2k3 and IIS, but this not steady and aways have problems happen, sometimes load very slow, so i decide to use apache,and then i use XAMPP to install apache php on my server, at last all works ok except the url rewrite with .htaccess.For iis i use IIRF to do the url rewrite, it’s similar to .htaccess, so i copy the rewrite rules to the .htaccess directly.Once i enabled the .htaccess rules ,the site got the 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.
The way fix
At begining, i google this error, and get following suggestions:
- 1. make sure you enabled the rewrite modle in apache httpd.conf
- 2. all following to your .htaccess
AddType application/x-httpd-fastphp5 .php
Action application/x-httpd-fastphp5 /fcgi-bin/php5fcgi
AddType application/x-httpd-php5 .php
Action application/x-httpd-php5 /fcgi-bin/php5fcgi - 3. add Options Indexes FollowSymLinks to the .htaccess
- 4. ….
I see, some are works for others ,but none of those worked for me. XAMPP enabled the rewrite module by default .
here is my .htaccess file
RewriteRule ^myMB.html myMB.php [I,L] |
it’s a simple line, but make the site down.Add finally, i find the problem.Go to the
xampplite\apache\logs |
and open error.log , at the bottom of the log i see something
.....htdocs/.htaccess: RewriteRule: unknown flag 'I' |
I find the problem easy, It’s the unknown flag ‘I’, that’s only for IIRF not apache .htaccess. After remove this flag ,the site work again.
Summary
I post this article, just want to say: when we got similar type of errors,we should look at the log files first, that can make we know the error more clearly. maybe just a small fault it can caused big problem, check the log file will save your time and help you fix the problem. Let’s all keep the good habits of check log file.Enjoy Reading!!