Page 1 of 1

mkdir creates OWNER 99 directory, can't delete it!

Posted: Fri Sep 05, 2008 9:18 am
by JAB Creations
PHP's mkdir creates directories with owner "99". I can delete files uploaded by PHP but not the directories! I've tried CHMOD in my FTP as well as chown via PHP without any luck. I'm not seeing any threads online on any where people actually bothered to list if they had success and of course how they resolved the issue. I've had problems in the past with my FTP client creating files that it couldn't delete though became aware of a file manager that comes with cPanel that was able to remove the files. However using the file manager to remove the directories was also fruitless.

1.) Suggestions please?

2.) Is there a way to set the owner when creating a directory?

Re: mkdir creates OWNER 99 directory, can't delete it!

Posted: Fri Sep 05, 2008 9:26 am
by JAB Creations
Looks like PHP is owner 99...

Code: Select all

$mkdir2 = rmdir($dir_child);
But my FTP nor cPanel's file manager can't remove the directories created by PHP. That makes no sense if PHP's chown won't work if PHP can both create and delete directories but I can't directly! So why would PHP have permission to create/delete but not change the owner?! :x


**EDIT** - forgot to type CAN'T, had can instead, confusing. :roll:

Re: mkdir creates OWNER 99 directory, can't delete it!

Posted: Fri Sep 05, 2008 9:30 am
by jayshields
Why not look through the cPanel code?

Re: mkdir creates OWNER 99 directory, can't delete it!

Posted: Fri Sep 05, 2008 9:32 am
by VladSun
man bash chown
Only the root user can change the owner of a file. You can change
the group of a file only if you are a root user or if you own the
file. If you own the file but are not a root user, you can change
the group only to a group of which you are a member.
man php chown
Description
bool chown ( string $filename , mixed $user )

Attempts to change the owner of the file filename to user user . Only the superuser may change the owner of a file.
Man pages, Jab ;)

PS: Yet another one:
man sudo ;)

Re: mkdir creates OWNER 99 directory, can't delete it!

Posted: Sat Sep 06, 2008 1:02 am
by JAB Creations
Well PHP is able to handle everything fine so as long as I code PHP correctly I shouldn't have any problems. That's what Beta testing is for. :mrgreen: