解决使用cPanel面板出现500 Internal Server Error的错误

购买了一个cpanel面板的空间,但是在安装程序的时候遭遇到了500 Internal Server Error的错误: 

  • Internal Server Error
  • The server encountered an internal error or misconfiguration and was unable to complete your request.
  • Please contact the server administrator, webmaster@demo.is36.com 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.
  • Apache/2.2.24 (Unix) mod_ssl/2.2.24 OpenSSL/1.0.0-fips mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 mod_perl/2.0.6 Perl/v5.10.1 Server at demo.is36.com Port 80 

解决方法很简单,打开cPanel面板“错误日志”页,一般会有2种错误:

  1. 第一种即“文件夹”给了太高权限,可被“组写入”:install is writeable by group
  2. 第二种即“文件”给了太高权限,可被“组写入”:index.php is writeable by group

只需要把“文件夹”和“文件”的“组写入”权限取消掉即可: 

  1. 对“文件夹”去掉“组写入”权限,也就是从默认775改成755即可
  2. 对“文件”去掉“组写入”权限,也就是从默认664改成644即可

以install目录和index.php文件为例:

以上2个修改均可以通过ftp修改或者chmod命令完成

  • chmod 755 install
  • chmod 644 index.php

而如果有比较多的文件与文件夹需要更改权限,使用chmod分别设置子目录和文件不同权限: 

先将当前目录中的所有“文件”包括文件夹设置为644:chmod 644 -R * 

再将当前目录中的所有“子目录”的权限设置为755:chmod 755 `find -type d` 

也可以用find命令实现:

  • find ./ -type f -exec chmod 644 {} \;
  • find ./ -type d -exec chmod 755 {} \;

Tags: cpanel, 500, chmod

上一篇: 验证IP是否被加入邮件黑名单
下一篇: 关闭与打开WordPress网站的评论功能

相关文章

发表评论