Script PHP para comprimir archivos en ZIP

PHP script to compress files into ZIP

This mini application is a PHP script to compress ZIP files that integrates exclusively PHP technologies, CSS, JS and HTML

The process is quite simple, only from the home page you press the select file button, then you choose the corresponding file, and when you have already chosen on the home page you press Upload and Compress, the system will create a zip of name that will display all the files found in the compressed folders.

The system after the file compression and generation process will take you to a new page called GenerarZip.php, there will be a link called DOWNLOAD NOW, where you can easily access the ZIP file created, with the files already compressed.

Video Explicativo Script PHP

Setting up the PHP script to compress ZIP files on a local server

Previous Applications

To install the application on a local server, I recommend the prior installation of the following applications:

XAMPP, Git, Visual Studio Code

XAMPP is the application in charge of implementing a apache server for them to work scripts PHP on a local computer.

Git is the world's most widely used repository manager, with which you can cleanly download code from GitHub.

Visual Studio Code is the world's most popular code editor, which I highly recommend in virtually every post on this blog.

Download GitHub App

The following is the GitHub repository download link for the application that allows you to compress files and generate a ZIP on a local server:

Application configuration of the PHP script for its operation on your computer

You must install the mentioned applications, with all the default parameters, after this procedure, from Visual Studio Code, you must open the following location:


From this location in Visual Studio Code, click View, Terminal. Inside the Terminal you choose the Git Bash option and copy the following code:

git clone

The zip folder will be created, inside the htdocs folder

Next, open XAMPP on your computer, activate the Apache service, and you will be able to see the application at the following URL:


Upload of the PHP script to compress files in ZIP

Due to the simplicity of the application, I will not address the issue directly, in the following related video (spanish), I explain the process at a general level:

Upload page with PHP + Database (MYSQL) to a Hosting

Any questions I remain pending, if you require more PHP applications, in Python or JavaScript I recommend you subscribe to my content on Youtube and be on the lookout for any changes, that I make.

Leave a Reply

Your email address will not be published.