php7.4安装zip扩展

Class 'ZipArchive' not found CMake 3.0.2 or higher is required system libzip must be upgraded to version >= 0.11

假期升级php,从7.0.1升到7.4,升级完成后部分功能受影响,按照项目报错情况开始排查:

导出功能报错:Class 'ZipArchive' not found

百度了一下,发现时zip拓展没有安装,查看phpinfo,确实没装,开始安装:

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

b8/35a8e3ae883f2dcb16e1c727c6686b.png

解压,然后进入包里,执行:phpize

42/26678fb5fbe04ffab342bf158a729c.png

执行: ./configure  --with-php-config=/usr/bin/php-config 

d5/96347bc79a893b9800f7b1a61db05e.png

[怒][怒][怒][怒][怒][怒][怒][怒][怒][怒][怒][怒]

报错了:checking for libzip... configure: error: system libzip must be upgraded to version >= 0.11

要先卸载libzip,yum remove libzip

然后下载最新的,解压

wget https://libzip.org/download/libzip-1.5.2.tar.gz

tar -zxvf libzip-1.5.2.tar.gz

这时发现还要安装cmake,再去下载cmake:

wget https://github.com/Kitware/CMake/releases/download/v3.15.4/cmake-3.15.4.tar.gz

解压:

tar -zxvf cmake-3.15.4.tar.gz

注意:cmake要按照文档安装

./bootstrap && make && sudo make install

漫长的等待,安装完成后,执行

cmake -version

出现版本号即安装成功。

5b/97e671b8de7c2b5d1beb66c05660d1.png

返回到libzip目录,执行

mkdir build 

cd build 

cmake .. 

等待。。。

make && make install

然后把最开始解压的的zip文件夹删除,重新解压,进去

phpize

 ./configure  --with-php-config=/usr/bin/php-config 

make && make install

一切妥当,且/usr/lib64/php/modules目录里生成里zip.so,然后去修改php.ini,添加

extension=zip.so;

修改:

zlib.output_compression = On;

然后重启php-fpm,再查看php -m

还是没有zip扩展,而且还报错了:

PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/zip.so' - libzip.so.5: cannot...

无语了。。。。。。

无奈之下,用yum search zip查了一下安装包,发现有

php74-pecl-zip

我日!!!!!!

执行:

yum install php74-pecl-zip

就好了,折腾了一个晚上!!!!



评论
  • dave

    To begin with, it is known in the whole world that it has not been easy to buy psychedelic online overnight.  buy magic mushrooms gives you the opportunity to buy psychedelic drugs online. You can buy psychedelic drugs online like LSD, DMT, Magic mushroom, psilocybin-mushrooms, psilocybe and shrooms etc. Buy LSD online from us and stand a chance of 100% guaranteed delivery. https://buymagicmushrooms.org gives you the opportunity to buy Mescaline online from us at affordable prices.

    2019-12-06 16:34:18

  • ferderico

    Hello, the process to buy weed online or to order medical marijuana online is very complicated. But we have guarantee our customers to get our products by mail ordering cannabis,CBD oil, strains,cannabis concentrates,marijuana edible, marijuana seeds from our shop online. Marijuana is sealed by using vacuum packaging. Packages have no smell and always bypass all Customs checks cause we offer discreet shipping of our package. Our Store is the most reliable online dispensary in the Cannabis Industry. We provide tracking details where u can track and see how your package is delivered online and also our customers have the chance to shop with us online without a medical marijuana card.Buy medical marijuana strains online. we got top grade space moneky meds,weed tins,zlittlez, Runtz weed tins, biscottis boyz, jungle boys and buy space monkey meds online www.weedtinsshop.com

    2019-12-06 16:32:04

  • ferderico

    Buy the best MEDS online from gloriouspharmacy shop with or without description at very good price and discount given for bulk purchase. just click on any of our product link below… i had to order here and had v the best products at an affordable price so i vouch for them….c BEST PLACE TO BUY VALIUM ONLINE WITH AND WITHOUT PRESCRIPTION,How should I take Adderall? Buy Xanax online, Buy Adderall Online, discreetly shipped to your home , Buy ativan in Canada(ADHD) and USA without prescription,where can I buy ADHD drugs,Buy Oxycodone securely ONLINE Order Ambient for sleep, how to buy ambien online, Buy Dilaudid securely online Purchase Morphine online,Buy viagra online,oxycodone, Order percocet online | Roxicodone for sale in canada and australia contact us at https://www.gloriouspharmacy.com

    2019-12-06 16:31:47

  • 我就随便看看

    主要参考两篇文档,其中这个就是你的,整了两三个小时,卡在最后这里,然后才发现你也没装好,你倒是在开头说一下啊,真的难受

    2019-11-20 00:00:47

  • 我就随便看看

    我装了几个小时,查了几篇文档,搞到最后一直弄不好,然后把你这个往最下面一拉。。。卧槽,这尼玛一模一样的报错

    2019-11-19 23:54:43

  • 我就随便砍看

    我装了几个小时,查了几篇文档,搞到最后一直弄不好,然后把你这个往最下面一拉。。。卧槽,这尼玛一模一样的报错

    2019-11-19 23:54:31