user1885136 user1885136 - 4 months ago 21
Linux Question

How to Create zip file in PHP using shell command on linux server

this is the command that actually i want to run using PHP in Linux server.

shell_exec(" zip -r abc.doc xyz.doc > ");

Using this command i script create damanged zip file, so can anyone help me to make it proper.


The syntax is incorrect. Try

zip foo abc.doc xyz.doc


zip -r foo abc.dox xyz.doc

depending upon whether you intend to replace the existing archive or not. See man zip for more.