Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Delete files ftp or cpanel large folder
November 19, 2008, 12:23 pm
rate this thread
Wonder if anyone has this problem.
As the only admin user of a site on a dedicated server,Using cpanel
I would like to delete files (lets call them the x-files in x-folder)
as and when necessary.
Ideally I would like to use my own php admin pages created in a
htaccess and php password protected folder to do this.
However, the x-folder (with publicly viewable images outside htaccess
folder) has permissions chmod 755, which means you can only delete as
a user - I would rather not permanently change to 777 for security
Because of the number of files in the folder, temporary change of
permissions or deleting via file manager is a pain and in fact crashes
Is there a way to assign user permissions to my admin http page and
send to the x-folder? I guess not?
The other more unsatisfactory option is to use an ftp client to
remove files individually but the one I use has a remote view limited
to 2000 files, so this is problem too!
Hope that makes sense.
In summary I would like to:
securely delete files in a large folder(over 5000 files) without
having to compromise the folder permissions.
Ideally - from a designed admin folder
or at least- via ftp
Any help would be appreciated.
Re: Delete files ftp or cpanel large folder
It sounds like you run PHP in the Apache API and its processes run as
the global web server user, rather than the account's user. The best
way to overcome this so you can delete via a PHP script, is to use
SuEXEC for CGI and simply make a PHP script run in the CGI API, so the
process runs as the account's own user for that particular script.
That is, unless you want to change to use some wrapper like suPHP, but
on a dedicated server without other account holders, it's safer to run
a non privileged web server user (i.e., nobody). If you have other
accounts/users on the server, you should strongly consider using suPHP
so everyone's scripts don't run as the same user and that would also
solve the ownership issues. Regardless, I agree that world
write/modify is a bad idea, so consider setting a PHP script to run as
CGI with SuEXEC.
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting. 24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!