user1885136 user1885136 - 5 months ago 24
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.