View Full Version : mkdir function create's apache owner dir's
bvvelzen
05-27-2004, 10:22 AM
hello,
when a user of us tries to make a directory with the mkdir function in php it wil create it as user apache and not as the user itself. This causes the problem that our user cannot delete the folder.
Greetings,
ProWebUK
05-27-2004, 10:55 AM
If safe mode was on they wouldnt be able to use the shell functions in the first place... but without moving away from the standard php versions your not going to stop it being created by apache unfortunately.
Chris
synergy
05-27-2004, 08:58 PM
How about the PHP function 'rmdir'?
l0rdphi1
05-28-2004, 09:41 AM
PHP's built-in file manipulation functions are very, very limited. For my Installatron DirectAdmin plugin, I wrote this class for file manipulation in PHP: http://www.l0rdphi1.com/tools/filemanip.phps
For instance, in normal PHP rmdir can not remove any dir if it has files or sub-directories in it. Using my class, you can simply do this:
$f = new FileManip('/path/to/your/workingdir');
$f->rm('thedir');And it will do the rest.
You can even use wildcards, such as:
$f->rm('thedir/*/cheese');
And you can work with multiple files at the same time:
$f->mkdir(array('one','two'));
Of course, none of this will fix the fact that directories are created as 'apache'. This, however, may be of use to you: http://www.faqts.com/knowledge_base/view.phtml/aid/16339/fid/31
Good luck, Phi1.
Powered by vBulletin™ Version 4.0.4 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.