barkster Posted July 24, 2007 Share Posted July 24, 2007 I've was trying to delete some folders that were created using mkdir and I'm unable to delete any of them with using sftp, ftp or through cpanel file manager. If I create a new folder with ftp in the same dir I can delete it but still cannot delete folders that were created with mkdir. I cannot change permission on them either. Here is the command I'm using. if(!file_exists("Gallery/".$userID)) mkdir("Gallery/".$userID); Quote Link to comment Share on other sites More sharing options...
yarnold Posted July 24, 2007 Share Posted July 24, 2007 Try running a script which contains this: chmod("/somedir/", 777); For the directories that you're trying to delete. It's by no means guaranteed to work but you never know! Quote Link to comment Share on other sites More sharing options...
redarrow Posted July 24, 2007 Share Posted July 24, 2007 rmdir() i think not sure Quote Link to comment Share on other sites More sharing options...
barkster Posted July 24, 2007 Author Share Posted July 24, 2007 I know how to do those my problem is that I'm not able to change permissions on the folders through any means after they are created nor am I able to delete. chmod & rmdir do not work if I create the directory through mkdir. I know it has to do something apache or php group creating it. Thus it won't let me modify it. Quote Link to comment Share on other sites More sharing options...
barkster Posted July 24, 2007 Author Share Posted July 24, 2007 This is what my host said. This is because PHP is running commands using the "nobody" username, while your permissions are for "usernameremoved" You'll need to convert to PHPsuExec to get this fixed up. Changing over to PHPsuExec can break some sites if they have .htaccess with php flags in it. Read this for more information: https://www.power360hosting.com/support/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=16&nav=0,3,14 When you're ready we can recompile Apache for you with PHPsuExec. I've gone ahead and fixed the permissions for the directories already there. Also, when you convert to phpsuexec, your scripts can't be more than 755 (so 777 will not work). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.