安裝一個php框架的時候提示不能在線解壓縮php
經過phpinfo查看沒有加載zip擴展,安裝開始。nginx
先安裝了一次發現不能make,,,什麼狀況!!!c++
提示這個錯誤,好吧解決。make: *** No targets specified and no makefile found. Stop.bootstrap
yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-develfreetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-develglib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devele2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel opensslopenssl-devel openldap openldap-devel nss_ldap openldap-clientsopenldap-servers
安裝這麼一堆後好了。繼續安裝zip中。。。vim
# wget http://pecl.php.net/get/zip # tar -zvxf zip # cd zip-1.15.5/ # /root/Downloads/php-5.4.45/scripts/phpize //提示沒有執行權限,增長權限 # chmod R 755 /root/Downloads/php-5.4.45/scripts # ./configure –with-php-config=/usr/local/php/bin/php-config
這個時候出現問題:php框架
checking for libzip... not found
configure: error: Please reinstall the libzip distribution框架
沒有安裝 libzip,安裝新版本curl
# curl -O https://libzip.org/download/libzip-1.5.1.tar.gz # tar -zxvf libzip-1.5.1.tar.gz # cd libzip-1.5.1 # mkdir build # cd build # cmake .. # make && make install
問題又來了,哭哭哭,沒有安裝cmake,好開裝php-fpm
# wget https://cmake.org/files/v3.3/cmake-3.3.2.tar.gz # tar xzvf cmake-3.3.2.tar.gz # cd cmake-3.3.2 # ./bootstrap # gmake # make install
巴拉巴拉一頓安,漫長等待後,中間沒有出現一個錯誤,帥。但是帥不過3秒。ui
查看版本時 cmake --version 報錯
CMake Error:Could not find CMAKE_ROOT!!! CMake has most likely not been installed correctly. Modules directory not found in /usr/local/bin Segmentation fault (core dumped)
問度娘說是執行這個就能夠了 hash -r 果真解決了,,,好吧繼續,libzip成功安裝。
zip也成功安裝。贊,下面要php加載擴展了,zip安裝完成之後會返回一個路徑:/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226
編輯php.ini
# vim /etc/php.ini # extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/zip.so
好的,重啓nginx
# service nginx restart
重啓 php-fpm
# service php-fpm restart
報錯,NOTICE: PHP message: PHP Warning: PHP Startup: Unable to load dynamic librar
# ldconfig /usr/local/lib # ldconfig /usr/local/lib64
執行這兩條命令後,重啓成功,查看phpinfo成功加載,哈哈
問題終於解決了,世界安靜了。