lopes_andre Posted March 26, 2010 Share Posted March 26, 2010 Hi, I'm trying do delete a folder in PHP but it gives me an error. I have the folder empty but gives me this error: Message: rmdir(./uploads/69/) [function.rmdir]: Directory not empty I'm using this code: rmdir($newPath); I'am using Windows in tests, but I will use Linux for production. How can I delete a folder? The folder is empty. Best Regards, Link to comment https://forums.phpfreaks.com/topic/196647-how-to-delete-a-folder-with-php/ Share on other sites More sharing options...
Mchl Posted March 26, 2010 Share Posted March 26, 2010 Do you (or more specifically: PHP) have permissions to do this? Also make sure there are no hidden files in this folder. Link to comment https://forums.phpfreaks.com/topic/196647-how-to-delete-a-folder-with-php/#findComment-1032450 Share on other sites More sharing options...
lopes_andre Posted March 26, 2010 Author Share Posted March 26, 2010 Thanks for the reply. The folder is created with: if (!is_dir($newPath)) { // Create new folder mkdir($newPath, 0700); } Is this correct? Link to comment https://forums.phpfreaks.com/topic/196647-how-to-delete-a-folder-with-php/#findComment-1032454 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.