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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
JAB Creations
DevNet Resident
Posts: 2341
Joined: Thu Jan 13, 2005 6:44 pm
Location: Sarasota Florida
Contact:

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

Post 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?
User avatar
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!

Post 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:
Last edited by JAB Creations on Fri Sep 05, 2008 11:46 am, edited 1 time in total.
User avatar
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!

Post by jayshields »

Why not look through the cPanel code?
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

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

Post 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 ;)
There are 10 types of people in this world, those who understand binary and those who don't
User avatar
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!

Post 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:
Post Reply