agentlion All American 13936 Posts user info edit post |
so my webspace is littered with various apache-owned files and folders that I no longer want. I have remnants of various old Gallery, Wordpress, Mambo, Plog, etc installations that each have created files/folders during their installation and therefore makes 'apache' the owner. Therefore, I do not have permission to FTP in and chown, chmod, or rm/rmdir these files. I really want to get them out of there, and would prefer not to have to make a big list of shit I want deleted and sent it to tech support (using Progress, so no SSH access).
I've found a couple PHP scripts that supposedly chmod specified files/folders to 666 or 777 (since the script runs on the server as the webserver-owner user) so I can delete them as non-owner, but they don't seem to be working.
any other ways to get rid of all these files I don't want?
edit - ha - i got it. simple enough:
<?php exec('rm -Rf /path/to/dir/') ?>
[Edited on October 2, 2005 at 1:02 PM. Reason : .]10/2/2005 12:54:37 PM |
Noen All American 31346 Posts user info edit post |
Ive been having the same issues. There's no way to get rid of them yourself, you have to either have SSH access or get someone on your host to go in and remove/reset permissions on the damn things.
Gallery is especially a fucking bitch about this stuff. 10/2/2005 5:03:30 PM |
agentlion All American 13936 Posts user info edit post |
na, i got it - just make a script with
<?php exec('rm -Rf /path/to/dir/') ?> and run it through the browser. It will run as 'apache' and therefore will delete whatever you put in the /full/path/to/director/ just make sure you put in the right path b/c it will delete everything in the folder specified. I was able to delete old g2data folders and several mambo and wordpress folders that were owned by apache10/2/2005 5:07:46 PM |
Noen All American 31346 Posts user info edit post |
hmm. I tried that, not with exec though, had to use the php unlink and rmdir, which definitely didnt work.
I'll go back and try the exec rm, makes sense. If it works I'll have to kiss you 10/2/2005 5:12:41 PM |