I installed Drupal 6.8 on a remote server ( Apache/2.2.3 (Debian) PHP/5.2.0 ) in a /Drupal subfolder then tried to uninstall it.
I could delete all Drupal files and folders except this
/Drupal/sites/default/files/
When tried to change the files folder's CHMOD through an FTP client I got this warning
'500 Unknown command
Server does not support attribute modifications'
I tried to run this PHP code
<?php
`chmod -R a+w sites/default/files`;
?>
and got this warning
Warning: shell_exec() has been disabled for security reasons in /server_dirs/www_dirs/domainname/www/www.domainname.com/html/Drupal/fix0.php on line 2
Also ran fix.php found here
http://drupal.org/node/34028 which did change the folder's CHMOD to 777 but I still cannot delete it.
Should I ask the host to remove it or is there another solution?
Thanks
Comments
You might have done this
You might have done this already, but check the chmod of the 'default' directory itself. Drupal should set it to 555 after installation and on every cron run. If it is, then this is the reason you can't delete it or anything within it. Once you change 'default' (and all its subfolders/files) to 755, you should be able to delete them all.
Also note that many, many servers are setup to reject 777 chmod. If they are setup that way, then you have to use 755 instead. If the host disallows 777 they should then be using a program that recognises scripts which need 777 to function, and allows them to work using the safer 755 chmod. (It's called 'sysexec' or something like that).
Thanks for responding
If I try to change the files folder's CHMOD
to 755 - or anything for that matter - ,through my FTP client, I receive a warning.
'Server does not support attribute modifications'
I can change the default folder's CHMOD but not the files folder's.
I ran this script within /Drupal/sites/
and got this response
Made writable: /server_dirs/www_dirs/termekkereso/www/www.domainname.com/html/Drupal/sites/default/files
And in fact the files folder's CHMOD changed to 777. I couldn't achieved this through FTP.
I'm a PHP newbie but I guess with some modification this script could be used to change the CHMOD to 755?
Am I wrong?
Strange new development :)
There was no need for that script.
I used this one
and it changed the files folder's CHMOD to 755.
Now I have default and files with 755.
The bad news is that I still can't delete this damn folder. :(
Have you got any sort of
Have you got any sort of htaccess files in the files folder?
Maybe some sort of protection against getting files hacked is preventing you from modifying the directory?
But to be honest, it looks to me like it might be a host set-up or configuration problem.
Maybe you've got some unknown script reigning in your power for the sake of server security?
Yes I had a .htaccess in the files folder
But I couldn't see it since my FTP client was not configured to show hidden files.
I suppose this was the cause although I didn't solve the problem by getting rid of .htaccess through FTP.
Rather I ran these two codes in the default folder. The first deleted whatever was in the files folder the second deleted the folder itself. Since rmdir() doesn't work if the folder is not empty there must have been something over there. :)
Don't you know how .htaccess ends up in the files folder?
It's not there after a normal install.
Try this
Try using this sctrip. Create 1.php and 2.php. Put them in the folder that contains the folder you want to delete.
In the last row of the files instead of "hello" type your the name of the folder you want to delete.
Run the first file and then run the second one. Don't worry if it shows errors. At this point you shouldn't find the folder but even if you do I think you should be able to delete it.
//----------------------------first file (1.php)-----------------------------------------
//----------------------------------------------------------------
//--------------------Second file (2.php)--------------------------
<?
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('hello'); ?>
//----------------------------------------------------------------
www.somered.com
www.somered.com/sstorage