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?
mkdir creates OWNER 99 directory, can't delete it!
Moderator: General Moderators
- JAB Creations
- DevNet Resident
- Posts: 2341
- Joined: Thu Jan 13, 2005 6:44 pm
- Location: Sarasota Florida
- Contact:
- JAB Creations
- DevNet Resident
- Posts: 2341
- Joined: Thu Jan 13, 2005 6:44 pm
- Location: Sarasota Florida
- Contact:
Re: mkdir creates OWNER 99 directory, can't delete it!
Looks like PHP is owner 99...
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?! 
**EDIT** - forgot to type CAN'T, had can instead, confusing.
Code: Select all
$mkdir2 = rmdir($dir_child);**EDIT** - forgot to type CAN'T, had can instead, confusing.
Last edited by JAB Creations on Fri Sep 05, 2008 11:46 am, edited 1 time in total.
- jayshields
- DevNet Resident
- Posts: 1912
- Joined: Mon Aug 22, 2005 12:11 pm
- Location: Leeds/Manchester, England
Re: mkdir creates OWNER 99 directory, can't delete it!
Why not look through the cPanel code?
Re: mkdir creates OWNER 99 directory, can't delete it!
man bash chown

PS: Yet another one:
man sudo
man php chownOnly 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 pages, JabDescription
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.
PS: Yet another one:
man sudo
There are 10 types of people in this world, those who understand binary and those who don't
- JAB Creations
- DevNet Resident
- Posts: 2341
- Joined: Thu Jan 13, 2005 6:44 pm
- Location: Sarasota Florida
- Contact:
Re: mkdir creates OWNER 99 directory, can't delete it!
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. 