简体   繁体   English

如何在Linux上使用PHP动态创建一个zip文件?

[英]How do I dynamically create a zip file using PHP on Linux?

I need my PHP script (running on a Linux server) to dynamically create a downloadable zip. 我需要我的PHP脚本(在Linux服务器上运行)来动态创建可下载的zip。 Presently my script is working locally on my Windows server, but not on Linux. 目前,我的脚本可以在Windows服务器上本地运行,而不能在Linux上运行。

If anyone can help me out with sample script, your help would be much appreciated. 如果有人可以通过示例脚本帮助我,将非常感谢您的帮助。

See the ZipArchive class. 请参阅ZipArchive类。 There are some code examples, eg under ZipArchive::addFile . 有一些代码示例,例如在ZipArchive::addFile

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM