CodeTalk
CodeTalk

Reputation: 3657

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.

Now, when I go to view my server running CentOS - it just shows a 500 Internal Server error.

I've tried:

  1. restarting server
  2. restarting apache service itself

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:

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

Upvotes: 1

Views: 34157

Answers (4)

Chiamaka Ikeanyi
Chiamaka Ikeanyi

Reputation: 484

chown -R user.usergroup /path_to_the_directory

Will resolve this. It is basically permission issues.

Upvotes: 1

jamsandwich
jamsandwich

Reputation: 385

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.

(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).

Upvotes: 1

CodeTalk
CodeTalk

Reputation: 3657

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.

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

To fix, I did this:

  1. ls -l in the directory causing the issue (mine was public_html)
  2. You should see the index file (e.g. index.php) that should be causing the issue. It is due to a root user having the only permission to the file and not your CPanel (or system) username. (note this system/cpanel name)
  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):

    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

I hope this helps someone else in the future.

Upvotes: 4

Mayank Sinha
Mayank Sinha

Reputation: 1

just install wordpress latest version make sure you have atleast php version 5.3 and above also look global register variable if it off or just delete htacess file from server and see what will happens generally 500 internal server gives when file permission is missing so you should delete htacess file

Upvotes: -2

Related Questions