简体   繁体   English

Apache Server抛出500内部服务器错误

[英]Apache Server Throwing 500 Internal Server Error

I had a LAMP application running wordpress and I deleted the whole directory and replaced with new files - php based. 一个运行wordpress的LAMP应用程序,我删除了整个目录,并替换为新文件 - 基于PHP。

Now, when I go to view my server running CentOS - it just shows a 500 Internal Server error. 现在,当我去查看运行CentOS的服务器时 - 它只显示500内部服务器错误。

I've tried: 我试过了:

  1. restarting server 重启服务器
  2. restarting apache service itself 重启apache服务本身

both completed successfully, but this didn't fix anything. 两者都成功完成,但这没有解决任何问题。 Now, I do not know where to go from here. 现在,我不知道从哪里开始。

apache logs @ /usr/local/apache/logs/error_log on apache: apache logs @ /usr/local/apache/logs/error_log

[Tue Apr 22 11:12:15 2014] [error] [] SoftException in Application.cpp:357: UID of script "index.php" is smaller than min_uid

I found the fix myself, this wasn't an error with Mysql at all, but rather a permissions issue with the index.php file I had. 我自己找到了修复程序,这根本不是Mysql的错误,而是我拥有的index.php文件的权限问题。

The error, which I found in /usr/local/apache/logs/error_log was: :is smaller than min_uid Premature end of script headers: index.php 我在/usr/local/apache/logs/error_log中找到的错误是::小于min_uid脚本头的过早结束:index.php

To fix, I did this: 要修复,我这样做了:

  1. ls -l in the directory causing the issue (mine was public_html ) ls -l导致问题的目录(我的是public_html
  2. You should see the index file (eg index.php) that should be causing the issue. 您应该看到应该导致问题的索引文件(例如index.php)。 It is due to a root user having the only permission to the file and not your CPanel (or system) username. 这是因为root用户拥有该文件的唯一权限,而不是您的CPanel(或系统)用户名。 (note this system/cpanel name) (注意这个系统/ cpanel名称)
  3. Run the following within the errorneous directory( Note : this command must be run within all subdirectories of the primary errorneous directory.): 在错误目录中运行以下命令( 注意 :此命令必须在主错误目录的所有子目录中运行。):

     sudo chown yoursystemuserhere:yoursystemgroupuserhere index.php 

    or to apply to the whole directory (thanks to @Prix): 或者应用于整个目录(感谢@Prix):

     sudo chown -R user:group /folder 
  4. You're all set. 你们都准备好了。

Further literature here: http://www.inmotionhosting.com/support/website/general-server-setup/uid-smaller-than-min-uid 更多文献: http//www.inmotionhosting.com/support/website/general-server-setup/uid-smaller-than-min-uid

I hope this helps someone else in the future. 我希望将来可以帮助别人。

I had similar symptoms on my cPanel VPS - I was able to use easyApache to recompile Apache and PHP which fixed the problem for me. 我在cPanel VPS上有类似的症状 - 我能够使用easyApache重新编译Apache和PHP ,这解决了我的问题。

(I realise my problem was slightly different to yours, but it may be helpful for people in the future who have the same problem I had). (我意识到我的问题与你的问题略有不同,但对于将来遇到同样问题的人来说,这可能会有所帮助)。

chown -R user.usergroup /path_to_the_directory

Will resolve this. 会解决这个问题。 It is basically permission issues. 它基本上是许可问题。

只需安装wordpress最新版本确保你有至少php版本5.3及以上也看起来全局注册变量,如果它关闭或只是从服务器删除htacess文件,看看一般会发生什么500内部服务器提供文件权限丢失所以你应该删除htacess文件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM