搜尋
首頁後端開發PHP7Centos7下php7如何安裝zip擴充

這篇文章跟大家介紹Centos7下php7安裝zip擴充的方法。有一定的參考價值,有需要的朋友可以參考一下,希望對大家有幫助。

Centos7下php7如何安裝zip擴充

安裝:

yum install -y php-devel #用于编译
cd /usr/local/src
wget http://pecl.php.net/get/zip-1.15.3.tgz  
tar -zxvf zip-1.15.3.tgz

cd zip-1.15.3  
phpize
whereis php-config
./configure --with-php-config=/usr/bin/php-config

錯誤:configure: error: Please reinstall the libzip distribution

最新版本請參考官網:https://nih.at/libzip/ ,libzip 需要 cmake 。

yum install -y cmake
cd ../
yum remove libzip
wget https://libzip.org/download/libzip-1.2.0.tar.gz
tar -zxvf libzip-1.2.0.tar.gz
cd libzip-1.2.0.tar.gz
mkdir build && cd build && /usr/local/bin/cmake .. && make && make install

又報錯:

CMake Error at CMakeLists.txt:4 (CMAKE_MINIMUM_REQUIRED):
  CMake 3.0.2 or higher is required.  You are running version 2.8.12.2
-- Configuring incomplete, errors occurred!

cmake版本過低,需新版本。

yum remove cmake
yum install -y cmake3
cmake -version

OK,cmake環境版升級完成。

然後再編譯 zip 。

cd ../zip-1.15.3
./configure --with-php-config=/usr/bin/php-config
make
make install

安裝過程中若出現

fatal error: zipconf.h: No such file or directory

##使用指令:

find /usr/local -iname 'zipconf.h'
ln -s /usr/local/lib/libzip/include/zipconf.h /usr/local/include

然後再執行一遍安裝即可。最後用指令查看有沒有zip.so檔。

ls  /usr/lib64/php/modules/

修改 /etc/php.ini :

zlib.output_compression = On
extension=/usr/lib64/php/modules/zip.so
重啟 apache:

service httpd restart

再查看 phpinfo,就有 zip 擴充了。

zip model

推薦學習:

php影片教學#

以上是Centos7下php7如何安裝zip擴充的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述
本文轉載於:csdn。如有侵權,請聯絡admin@php.cn刪除

熱AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover

AI Clothes Remover

用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool

Undress AI Tool

免費脫衣圖片

Clothoff.io

Clothoff.io

AI脫衣器

AI Hentai Generator

AI Hentai Generator

免費產生 AI 無盡。

熱門文章

R.E.P.O.能量晶體解釋及其做什麼(黃色晶體)
3 週前By尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.最佳圖形設置
3 週前By尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.如果您聽不到任何人,如何修復音頻
3 週前By尊渡假赌尊渡假赌尊渡假赌
WWE 2K25:如何解鎖Myrise中的所有內容
4 週前By尊渡假赌尊渡假赌尊渡假赌

熱工具

Dreamweaver CS6

Dreamweaver CS6

視覺化網頁開發工具

SecLists

SecLists

SecLists是最終安全測試人員的伙伴。它是一個包含各種類型清單的集合,這些清單在安全評估過程中經常使用,而且都在一個地方。 SecLists透過方便地提供安全測試人員可能需要的所有列表,幫助提高安全測試的效率和生產力。清單類型包括使用者名稱、密碼、URL、模糊測試有效載荷、敏感資料模式、Web shell等等。測試人員只需將此儲存庫拉到新的測試機上,他就可以存取所需的每種類型的清單。

PhpStorm Mac 版本

PhpStorm Mac 版本

最新(2018.2.1 )專業的PHP整合開發工具

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

強大的PHP整合開發環境

SublimeText3 Linux新版

SublimeText3 Linux新版

SublimeText3 Linux最新版