SoftException UID is smaller than min_uid

When working with SSH (shell) there are various things you can do, among the simplest is creating and editing files that are in use on your hosting account. There can be times when you run across issues in the WHM or cPanel GUI after working within the shell.

What is the error?

This particular error occurs more often than others when you are trying to edit a file in the GUI. The error you receive when attempting to save the file is similar to the one below:

SoftException in Application.cpp:357: UID of script "/home/mysite/public_html/index.php" is smaller than min_uid
Premature end of script headers: index.php

What causes the error?

This error is caused by creating a file within the shell when logged in as the root user. If you check out the lsit of files, you will see that the index.php file is owned by root where the others are owned by the cpanel user.

How can I fix it?

To fix the error, you need to change the ownership of the file to the cpanel username. You can do that by using the following command. Be sure to change the user123 to the proper cpanel username and index.php to the specific file you are going to change.

chown user123:user123 index.php

After running the command, you can check the ownership of the files by running ls -lah command for the resident folder of the files. It should appear as below:

In this case you can see that I've highlighted the index.php file, and you can see that it's owned by the user and group root.

So if I tried to access the index.php script as is, I'd get the same error as you. Instead if you were to run this if your website user was user123:

chown user123.user123 /home/httpd/html/index.php

Then you should notice that the file listing for that file changes to:

-rw-r--r-- 1 user123 user123 3.0K Aug 27 2009 index.php

You should then be able to access that script directly from your website without an issue. If you don't have access to the server or from your control panel to change the owner of files, then you would need to contact your web host to do this for you.

This article requires that you have access to SSH and be able to make a change to the file. If you are unable to make that change, then you will need to speak with your host's support staff and find out if it's possible for them to make the change for you. If they can't, then you will need to ask them about your error and whether it's something they can resolve for you.