Home>Article>Backend Development> Detailed explanation of the steps to install zip extension and libzip in PHP

Detailed explanation of the steps to install zip extension and libzip in PHP

php中世界最好的语言
php中世界最好的语言 Original
2018-05-17 14:57:28 5157browse

This time I will bring you PHPInstallationDetailed explanation of zip expansion and libzip steps, what are thenotesfor PHP installation of zip expansion and libzip, the following is a practical case, let’s take a look one time.

Linux:

When php wants to call the \ZipArchive class, it needs to install the ZIP expansion library, and the zip expansion library needs to be installed first. Install libzip.

We first download:

wget http://pecl.php.net/get/zip

Download the zip, and then tar -zvxf zip, you will get the decompressed zip-1.14.0

cd zip-1.14.0

phpize

and then ./configure See if libzip is missing?

If missing, install libzip first, wgethttps://nih.at/libzip/libzip-1.2.0.tar.gz

tar -zxvf libzip -1.2.0.tar.gz

cd libzip-1.2.0

./configure

make

make install

After the installation is complete, you can install the zip. If you can't find 'zipconf.h', look for it first. In fact, you can find it

find /usr/local -iname 'zipconf.h'

But why can't you find it? Can

ln -s /usr/local/lib/libzip/include/zipconf.h /usr/local/include . Just install the zip.

Modify php.ini, you can callphpinfo() to see which path php.ini is in

extension_dir = "./"

Modify to extension_dir = "/var/zip-1.14.0 /modules"

Add extension="zip.so"

Restart apache, httpd -k restart

I believe you will read the case in this article You have mastered the method. For more exciting information, please pay attention to other related articles on the php Chinese website!

Recommended reading:

Detailed explanation of the steps to query, update and delete user information in the ThinkPHP framework

Installing the yaf extension in PHP7.1 Detailed explanation of steps

The above is the detailed content of Detailed explanation of the steps to install zip extension and libzip in PHP. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn