Home>Article>Backend Development> Detailed explanation of the steps to install zip extension and libzip in PHP
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:
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!