Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Accidentall I created the folder on remotely server (Server OS is Linux) using php: mkdir("folder_name",0);

Now I can not delete this folder from server. I think this is from permission, because 0 is not correct permission.

When I am trying delete this folder which php function rmdir(), php returns error

Unable to access on this folder.

Same error obtain I, when trying change access which php's chmod() function.

I can not delete folder which FTP client also.

So how can I delete this folder?

share|improve this question
    
Is the directory empty? Who is owner of the directory? ls -l directory should give as enough information to proceed. –  peterph Dec 5 '12 at 13:58
5  
Do you have shell access to the server? And if so, do you have root access? –  gertvdijk Dec 5 '12 at 13:59
    
Are you sure that your folder is even created? –  Karlson Dec 5 '12 at 15:32
    
You created the directory with permission 0 (instead of something like 0755). Ask the admin to remove it. –  ott-- Dec 5 '12 at 16:12
2  
In *nix/BSD, we call them directories, not folders. That's a Windows-ism. –  Rob Jul 14 '13 at 13:33
show 1 more comment

2 Answers

<?php

chmod("folder_name",0700);   // Read, write, execute for owner
rmdir("folder_name");

?>
share|improve this answer
add comment

Does running the below help?

system('rm -Rf some_dir');
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.