Tar gz a file using the exec function
Compress files in Php can be very useful and the exec command can simplify the procedure on linux.
Copy and paste the following codes into your editor and run it (code comments are included).
If you want to see the live result, try it here (new window).
Compress a file
Notes:
- for more information about the exec command:
Function.exec;
- You must have the rights to write files inside the corresponding directory;
- You must run this script on linux;
- You can also compress a full directory including paths.
Comments
You are welcome to post comments onto this
Webmaster forum - php