PHP installation Zip extension, and Libzip installation issues

Source: Internet
Author: User
Tags zip extension

Just use Laravel Excel to do an Excel upload parsing, in the server report error, find Ziparchive class, Baidu need to install zip extension, finishing a bit of installation method;

1. Download and install the zip

wget http://pecl.php.net/get/ziptarzipzip-  1.14. 0   phpize. /Configuremake doinstall

Phpize command if the prompt phpize can not find , go directly to the PHP installation location under the Bin folder to find running Phpize also remember to write the full path;

./configure if the error can not find Php-config: Remember to take the road./configure--with-php-config=/usr/local/php/bin/php-config

If you execute./configure--with-php-config=/usr/local/php/bin/php-config found that the error is missing libzip, you need to install Libzip first;

wget https://nih.at/libzip/libzip-1.2.0.tar.gztar -zxvf libzip-1.2. 0. Tar . GZCD libzip-1.2. 0 . /make makeinstall

When installing libzip./configure if the ' zipconf.h ' is notfound, or the variable with the file is not defined because the header file is not found;

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

After finding this file;

LN -s/usr/local/lib/libzip/include/zipconf.h/usr/local/include

and then compile;

Finally modified PHP.ini added after the extension of the compilation, restart PHP-FPM;

PHP installation Zip extension, and Libzip installation issues

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.