suPHP 0.6.1

  • thin_phone
  • Newbie
  • Newbie
  • thin_phone
  • Posts: 5

Post 3+ Months Ago

have just spent hundreds on a new server and it gives me this whenever i try to run PHP



"Internal Server Error

UID of script "/domains/e/x/example.co.uk/public_html/index.php" is smaller than min_uid
suPHP 0.6.1"


Please help.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13503
  • Loc: Florida

Post 3+ Months Ago

http://lists.marsching.biz/pipermail/su ... 01036.html

Apparently, you either have to determine what the value of min_uid is (100, 1000, etc) & give the file to a user with that uid or higher. Or, change min_uid to zero. (probably not such a good idea)

But looking at the documentation, it appears that min_uid applies to the user it's executing as, not the file ownership.
  • thin_phone
  • Newbie
  • Newbie
  • thin_phone
  • Posts: 5

Post 3+ Months Ago

Thanks for that quick reply. I know how to change the min_uid but i havnt got a clue how to change the uid.

Any ideas?
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13503
  • Loc: Florida

Post 3+ Months Ago

Execute suPHP as a different user ?
  • thin_phone
  • Newbie
  • Newbie
  • thin_phone
  • Posts: 5

Post 3+ Months Ago

How would one go about doing this on a ubuntu server?
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13503
  • Loc: Florida

Post 3+ Months Ago

Well when you put it like that, I've got one of those sitting right next to me. I'll install it and figure it out. :D
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13503
  • Loc: Florida

Post 3+ Months Ago

Ah ok, it is something to do with who owns the file.

The PHP file being executed has to be owned by someone with a UID higher than min_uid. Pretty much any user you add to the system via "adduser" is going to have a UID of 100 or higher, which is the default min_uid.

For instance, if you're viewing
http://site.com/test.php

and documentroot is
/var/www/

putting test.php as
/var/www/test.php

and /var/www/test.php is owned by root, you need to chown test.php to another user.

for instance on my test box over here, I already had a file named "test.php" owned by the default user I use to do stuff via FTP and everyhting else. That user was added via adduser a long time ago.

But as soon as I chowned "test.php" to belong to root, I got the internal server error.

so,
Code: [ Select ]
chown username:usergroup /path/to/file.php
  • thin_phone
  • Newbie
  • Newbie
  • thin_phone
  • Posts: 5

Post 3+ Months Ago

It works now. Thanks so much.

Just one last quick question. Do you know of any way to set the default owner for a directory and all sub directories? Everytime i edit a file or create a new one it gives me the original error and i have to update the permissions/owner.
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13503
  • Loc: Florida

Post 3+ Months Ago

I believe files are owned by whoever created them by default.
Which would mean you're likely editing files as root or some other superuser when you should be creating & editing them as the user whom they will be executed as.
  • petteyg
  • Born
  • Born
  • petteyg
  • Posts: 1

Post 3+ Months Ago

thin_phone wrote:
It works now. Thanks so much.

Just one last quick question. Do you know of any way to set the default owner for a directory and all sub directories? Everytime i edit a file or create a new one it gives me the original error and i have to update the permissions/owner.


This is done through chmod, 1 = sticky, 2 = setgid, 4 = setuid.

Setuid means all subsequent files/directories in the directory will inherit the directory owning user.
Setgid means all subsequent files/directories in the directory will inherit the directory owning group.
Sticky means all files created will be modifiable only by their owner, not their group. Haven't used this one before, can't tell you how it really behaves :)

chmod 6664 will change a directory to r-xr-sr--. The lowercase s means that the bit it is sitting on top of is set (not sure of the techincal term for that, but you get the point).
chmod 6644 will change a directory to r-xr-Sr--. The uppercase S means that the bit it is sitting on top of is UNset.

AFAIK, it will always sit on the executable bit. Somebody who knows better can correct me if I'm wrong. Sticky displays t or T instead of s or S, and it shows over the executable bit for others.
  • blakeus1981
  • Born
  • Born
  • blakeus1981
  • Posts: 1

Post 3+ Months Ago

I'm having this problem too - im a bit of a noob when it comoes to ssh, but I logged in as the root (like i always do) and I wanted to copy a site from a testing domain's directory to the live director.

It copies across ok, but when i go to view the site, despite checking via ftp that its all in there i get:;

Internal Server Error

UID of script "/domains/f/r/nameofdomain/web/public_html/index.php" is smaller than min_uid

suPHP 0.6.2


really annoying - what do i need to do? I get the feeling i have to add a new user or something... any help on how I do that?

Thanks a ton in advance.

Blake
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Posts: 9090
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

Hi Blake,

When you are logged in as root and you copy files over to another area the user that owns the files are still root. When you are using suPHP that will cause problems as suPHP makes sure that any file running for that domain matches the owner of that domain on your system (or at least a uid above 100 which would be a regular user, root would definitely be below 100). Having the owner of the file as root would not match or would be too low so you get that error. For the file(s) you copied over make sure make sure you change the owners to whatever owner is for that domain. So for example if the owner of the files were supposed to be blakeus1981 then you would do this:

chown blakeus1981.blakeus1981 filename.html

the dot notation above means change the user of the file and change the group of the file at the same time. Before the dot is the user, and after is the group. If you want to change multiple files at once you can do something like:

chown blakeus1981.blakeus1981 *

And that will change all the file owners and groups for whatever directory you are in. Hope that helps!

Post Information

  • Total Posts in this topic: 12 posts
  • Users browsing this forum: No registered users and 97 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.