user1885136 user1885136 - 1 year ago 79
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.

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download