This is probably obvious to many, but if any of the program execution functions is enabled on your system ( exec , system , shell_exec ), you can use them for a simple gzip file.
exec("gzip ".$filename);
NB: Be sure to properly clean the $filename variable before using it, especially if it comes from user input (but not only). It can be used to run arbitrary commands, for example, by adding something like my-file.txt && anothercommand (or my-file.txt; anothercommand ).
Niavlys Feb 09 '17 at 21:10 2017-02-09 21:10
source share