Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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
In *nix/BSD, we call them directories, not folders. That's a Windows-ism. – Rob Jul 14 '13 at 13:33

Does running the below help?

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

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

share|improve this answer

If you are using shared hosting, you can change permissions on folders using a file manager provided by your control Panel.

For instance, in CPanel, you have a file manager that let you change the permissions for files and folders.

enter image description here

share|improve this answer

Your Answer


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.