I just installed the module "Image Picker" & uninstalled it shortly afterwards (as it was not what I needed).
So I disabled it on the modules page & then deleted it from the modules directory.
The problem is that it has left behind a folder "imagepicker" in files & I cannot delete them.
Each time I try, I get a 'permission denied' error.
example :
Response: 200 PORT command successful
Command: LIST
Response: 150 Opening ASCII mode data connection for file list
Response: 226 Transfer complete
Status: Directory listing successful
Command: DELE .htaccess
Response: 550 .htaccess: Permission denied
I've tried PASV aswell & have tried to CMOD but cannot.
Any idea why this happens & if there is a way I can fix it ?
It's pretty annoying as having undeletable folders/files left by a module isn't good.
Comments
This is a common problem in
This is a common problem in shared hosting accounts.
The files that cannot be removed are created with the account apache runs in.
You will need to ask your hosting company to have them removed.
-----------------------------------------
Joep
CompuBase, Drupal websites and design
-----------------------------------------
Joep
CompuBase, Dutch Drupal full service agency
thanks for the reply. I
thanks for the reply.
I think that the problem lies with the script the module uses to create the directories/files.
It's pretty annoying as one tests a module & then can't get rid of what it creates.
All Life Has Equal Value
follow up : perhaps useful
follow up : perhaps useful to someone else encountering a similar problem.
Contacted my host & they pointed me to a couple of scripts that allow one to change the permissions of the php script created httpd files.
Just save these codes as a php file & upload it not in the directory of the locked files, but the directory above eg files/frkedit where frkedt is locked, you'd place the php in /files & then point your browser to it to make it run.
<?php$old = umask(0000);
chmod("name of folder or flile", 0777);
umask($old);
?>
sets the permissions to 777 meaning you can delete them.
This one if you have wanted to changer the permissions in a whole directory/sub directorys etc)
<?phpfunction rchmod($parent, $dmod, $fmod) {
if (is_dir($parent)) {
$old = umask(0000);
chmod($parent, $dmod);
umask($old);
if ($handle = opendir($parent)) {
while (($file = readdir($handle)) !== false) {
if ($file === "." or $file === "..") {
continue;
} elseif (is_dir($parent . '/' . $file)) {
rchmod($parent . '/' . $file, $dmod, $fmod);
} else {
$old = umask(0000);
chmod($parent . '/' . $file, $fmod);
umask($old);
}
}
closedir($handle);
}
} else {
$old = umask(0000);
chmod($parent, $fmod);
umask($old);
}
}
rchmod('folder name or file name/', 0777, 0666);
?>
Finally this one just deletes the files/folders (again , placed in the directory above the lcation of the locked folders/files.
<?
function effacer($dir)
{
if ($handle = opendir($dir))
{
while (($file = readdir($handle)) !== false)
{
if ($file === "." or $file === "..")
{
continue;
}
elseif (is_dir($dir . '/' . $file))
{
effacer($dir . '/' . $file);
}
else
{
unlink($dir . '/' . $file);
}
}
closedir($handle);
}
rmdir($dir);
}
effacer('name of directory to delete/'); ?>
note : this was done on a apache server so I'm not sure if it works on other servers.
All Life Has Equal Value
These codes have very much helped me
Respect to steve-psngs
These codes have very much helped me
Thanks!
Elena — My blog
Thanks!
Thanks very much, I was able to use the second one to successfully change the permissions and delete the 'sites' folder. I created a file named "777.php" in my Drupal folder (at the same level as the sites folder, not within it) that contained the following:
<?phpfunction rchmod($parent, $dmod, $fmod) {
if (is_dir($parent)) {
$old = umask(0000);
chmod($parent, $dmod);
umask($old);
if ($handle = opendir($parent)) {
while (($file = readdir($handle)) !== false) {
if ($file === "." or $file === "..") {
continue;
} elseif (is_dir($parent . '/' . $file)) {
rchmod($parent . '/' . $file, $dmod, $fmod);
} else {
$old = umask(0000);
chmod($parent . '/' . $file, $fmod);
umask($old);
}
}
closedir($handle);
}
} else {
$old = umask(0000);
chmod($parent, $fmod);
umask($old);
}
}
rchmod('sites/', 0777, 0666);
?>
Bookmarking.
Bookmarking.
Complete Computer Care
pro!
very pro indeed!
worked like a charm =)
Thank you so much!!!
Thank you so much! I've tried A LOT of things to get this one directory out of my root and it wouldn't delete. I just made a php file out of those codes and pointed to that file in my browser and finally, the directory is gone. Thank you....very much appreciated.
-Joshua H.
Thanks
thank you it worked
interested in this
bookmarking