Forum Moderators: coopster
-I made a new folder and put the permissions on 777.
-I ran my php code i was working on, which makes folders with mkdir through php and then writes a single .txt file in each folder.
-The command for making the folders i used was:
mkdir($rootdir."/".$pieces[0]."/".$pieces[1], 0777);
I cannot delete these folders anymore for some reason i get a 550 error message. Why? 777 means all permissions right? What's wrong with this then? i should be able to delete this right?
added: Can i delete these folders with a deldir command or so?
Some of the directories just don't exist, they are there visually, but when i click it said that it's not there.
But some are clearly theree as i can enter them do, but whem i want to delete it sais no permission,
the directory's are like this:
/777/children/fun/
/777/children/games/
/777/health/care/
/777/health/dentist/
etc.etc.
-The first time i ran the programm i had the permission set to 700, to check if this was the problem i made a new folder an ran the program again with 777, and now still can't delete the directory but now i have 2 unremovable directory's :o.
I also tried wsftp and clicked del no luck.
I will try the rmdir in php to see if that will do the trick.
I guess this has something to do with shared hosting , because i'm not supersupersupervisor over all accounts but just the 'manager' or one account? but i should still be able to delete it..ok off to try the php.
(came back to edit:) some directories do contain 1 .txt file, i can't delete. but im still gonna try what happens.
Using WsFTP, if you go log in, and right click -> CHMOD, what happens if you change the directorys to 777, and then try deleting them? Does it let you?
The first time i ran the programm i had the permission set to 700, to check if this was the problem i made a new folder an ran the program again with 777, and now still can't delete the directory but now i have 2 unremovable directory's :o.
If you ran the program again without removing the directories, then the permissions would still be set to 700, as the mkdir command could not create a new directory. Try CHMOD'ding them to 777, remove, and try again.
HTH,
JP
The problem here is that when you create directories using php script, the owner of those dirs/files is apache.
You can check this by your ftp client the owner of the dirs/files should have user-id as 48(which is of apache).
Even if you give 777 permissions to your root dir when u create dir/files using php script they don't get the 777 permissions thats why u can't delete them using ftp client as well. You can delete them by running a php script with rmdir command which removes an empty dir. So first you'll have to empty the directory using unlink command to remove all the files.
Even if you give 777 permissions to your root dir when u create dir/files using php script they don't get the 777 permissions thats why u can't delete them using ftp client as well.
Another approach would be to have your script change permissions to 777 on every new file it creates.
That way you should be able to remove the directory with subdirs and files as you'd have full permissions on them.