Internal Server Error 解决办法

Categories: 前端, 网站相关
Tags:
Comments: No Comments
Published on: 2011 年 04 月 28 日

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

Please contact the server administrator, webmaster@pureisle.net 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 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
在给文件夹设置权限时出现500 internal server error解决方法

如果你只是想解决问题本身,可以到看一下最后面的红色字体“总结”,如果你想了解解决问题的过程,可以看完全文。

一个客户用的是dedecms的PHP版本.在系统设置里面,有一个页面打不开,总是提示:
You don't have permission to access /idiy/sys_info.php on this server.

于是他就去CP面板中将sys_info.php的权限设置为777,但是这样之后,就无法打开页面了,提示500内部服务器错误.
我研究了好半天,把上级文件夹设置了777,也是不行.甚至整个网站都无法打开了。

我于是给客服发邮件H9的客服回复 ,他首先让我查看CP面板的错误日志,把前30行发给他。如下是日志:

[font=Verdana][size=2][color=#000080][Fri Jul 09 23:38:48 2010] [error] [client 116.10.184.103] File does not exist: /home/wwxin/public_html/404.shtml  
[Fri Jul 09 23:38:48 2010] [error] [client 116.10.184.103] File does not exist: /home/wwxin/public_html/favicon.ico  
[Fri Jul 09 23:38:47 2010] [error] [client 116.10.184.103] File does not exist: /home/wwxin/public_html/500.shtml, referer: [url]http://www.nnidiy.com/idiy/index_menu.php[/url]  
[Fri Jul 09 23:38:47 2010] [error] [client 116.10.184.103] SoftException in Application.cpp:601: Directory "/home/wwxin/public_html/idiy" is writeable by   
……  
省略  
……  
com/idiy/index_menu.php[/url]  
[Fri Jul 09 23:19:15 2010] [error] [client 113.232.210.239] SoftException in Application.cpp:601: Directory "/home/wwxin/public_html/idiy" is writeable by group, referer: [url]http://www.nnidiy.com/idiy/index_menu.php[/url]  
[Fri Jul 09 23:19:12 2010] [error] [client 113.232.210.239] File does not exist: /home/wwxin/public_html/500.shtml, referer: [url]http://www.nnidiy.com/idiy/index_menu.php[/url]  
[Fri Jul 09 23:19:12 2010] [error] [client 113.232.210.239] SoftException in Application.cpp:601: Directory "/home/wwxin/public_html/idiy" is writeable by group, referer: [url]http://www.nnidiy.com/idiy/index_menu.php[/url]  
[Fri Jul 09 23:18:01 2010] [error] [client 113.232.210.239] File does not exist: /home/wwxin/public_html/403.shtml, referer: [url]http://www.nnidiy.com/idiy/sys_info.php[/url]  
[Fri Jul 09 23:15:40 2010] [error] [client 113.232.210.239] File does not exist: /home/wwxin/public_html/403.shtml, referer: [url]http://www.nnidiy.com/idiy/sys_info.php[/url]  
[Fri Jul 09 23:14:48 2010] [error] [client 116.10.184.103] File does not exist: /home/wwxin/public_html/404.shtml  
[Fri Jul 09 23:14:48 2010] [error] [client 116.10.184.103] File does not exist: /home/wwxin/public_html/favicon.ico  
[Fri Jul 09 23:14:36 2010] [error] [client 116.10.184.103] File does not exist: /home/wwxin/public_html/404.shtml  
[Fri Jul 09 23:14:36 2010] [error] [client 116.10.184.103] File does not exist: /home/wwxin/public_html/favicon.ico  
[Fri Jul 09 23:14:36 2010] [error] [client 116.10.184.103] File does not exist: /home/wwxin/public_html/403.shtml, referer: [url]http://www.nnidiy.com/idiy/sys_info.php[/url]  
[Fri Jul 09 23:14:15 2010] [error] [client 116.10.184.103] File does not exist: /home/wwxin/public_html/404.shtml  
[Fri Jul 09 23:14:15 2010] [error] [client 116.10.184.103] File does not exist: /home/wwxin/public_html/favicon.ico  
[Fri Jul 09 23:14:11 2010] [error] [client 116.10.184.103] File does not exist: /home/wwxin/public_html/404.shtml  
[Fri Jul 09 23:14:11 2010] [error] [client 116.10.184.103] File does not exist: /home/wwxin/public_html/favicon.ico  
[Fri Jul 09 23:13:49 2010] [error] [client 116.10.184.103] File does not exist: /home/wwxin/public_html/404.shtml  
[Fri Jul 09 23:13:49 2010] [error] [client 116.10.184.103] File does not exist: /home/wwxin/public_html/favicon.ico  
[Fri Jul 09 23:13:49 2010] [error] [client 116.10.184.103] File does not exist: /home/wwxin/public_html/403.shtml, referer: [url]http://www.nnidiy.com/idiy/sys_info.php[/url]  
[Fri Jul 09 23:13:46 2010] [error] [client 116.10.184.103] File does not exist: /home/wwxin/public_html/404.shtml  
[/color][/size][/font]  

他给我分析日志说 :
Sat Jul 10 01:04:31 2010] [error] [client 71.229.226.14] SoftException in Application.cpp:601: Directory "/home/wwxin/public_html/idiy" is writeable by group

The directory "idiy" has the wrong permissions, I have fixed them for you.

说父路径权限错误,他们已经帮我修复了。可是我回头,再次修改文件夹权限时,不知道怎么搞的,又搞的内部服务器错误了

后来他们又回复邮件:
All directories require 755 or lower permissions, and files require 644 or lower permissions to execute on our servers
意思是这样的:
文件夹权限要设置为755或者更低,文件权限要设置为644或者更低.
我按照他的要求将文件夹设置为755,文件设置为644,但是最开始的错误又重现了,就是提示sys_info.php没有权限。
如果我设置其为777,那么dedecms的系统设置页面又打不开了,提示内部服务器错误。于是我将这个情况告诉了客服,他们说:
Our new mod security rules were blocking the request. I've disabled modsec for your domain to resolve the issue.

大概意思是:
我们的新的mod 安全规则正在阻止这个请求。我已经为你的域名禁用了这个模块安全。
我重新打开系统设置界面,设置系统关键词,点“提交”一点问题都没有。呵呵。
晕倒。
原来是服务器限制。我问他们以后还会不会在其他客户上阻止,他们说,不能一次性阻止,只能针对域名来进行阻止。
可能是某些php文件涉及到了系统安全的函数,对他们的权限进行了限制。

总结一下:
如果你想解决PHP程序中的文件权限设置错误,并且不造成网站发生500内部服务器错误。那么需要依循以下规则:
1.保证:文件夹权限要设置为755或者更低,文件权限要设置为644或者更低。
2.如果文件权限是644但是PHP程序功能还是不好用,提示文件权限不够,那么可以联系客服,让他们将安全模块禁用。

最多留言日志

No Comments - Leave a comment

Leave a comment

电子邮件地址不会被公开。 必填项已用*标注

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>


Welcome , today is 星期六, 2017 年 10 月 21 日