Files compression in archive and another manipulations with files on server with php protocol


It happens often that you don’t have shell, only ftp access to site. Or you need to upload on your site or download a lot of files.

If you have sftp, you will download an archive, and then just open it on the server. But if you even have only ftp, there is a chance of reaching the shell from php. To do this download php script "web-shell". It’s really easy to use it - install it, then command window appears on you screen, below there’s result of its work. For getting directory listing use command “ls”. To learn if hosting has the ability of archiving, use command "man zip" or "man unzip" ect. Then use help that will be displayed for further instructions. But unfortunately, execution of shell command from the php on virtual hostings could be blocked.
Here you’ll find this very class very helpful, because it can archive files.
It works very easy: $z = new PHPZip(); $z -> Zip (“path to the folder needed to be archived”, “name of the archive, where folder should be added, including path to this archive”)
One more useful utilite is web-file-manager, with its help you can easily shift files from the catalog, it has really user-friendly and easy interface.
At last, problem with scripts creating files with the rights of apache appears very often, meanwhile those files cannot be deleted from the ftp later, and cannot even be edited. This problem can be resolved by this script, that changes attributes to 777, after that files can be edited and deleted. Syntax of using http://your.site/perm.php?full_path_to_file_or_directory
And the most important thing: after finishing work DELETE these service scripts from the site.