PHP原始碼包編譯安裝錯誤及解決方法彙總

科技探索者發表於2017-11-13

在我們原始碼編譯安裝PHP的時候,總會遇到各種各樣的問題,每次編譯的時候都會提示我們去安裝其他

要依賴的包,筆者根據自己多次安裝的經驗以及網路上找到的不少資料,將出錯提示與解決方法做了一

個小小的彙總。


首先,我們在編譯的時候需要安裝很多的包,而這些包不一定在我們本來的yum源中有,所以我們可以

先去安裝一個yum的擴充套件源。


yum  install  -y  release


yum install -y freetype-devel libevent libevent-devel libxml2 libxml2-devel ncurses ncurses-devel  openssl openssl-devel  libjpeg libjpeg-devel libpng libpng–devel zlib-devel  bzip2 bzip2-devel libmcrypt libmcrypt-devel


然後我們再來看看可能會遇到的各種錯誤以及解決方法:


錯誤:configure: error: freetype-config not found.


解決:yum install freetype-devel



錯誤:configure: error: libevent >= 1.4.11 could not be found 


解決:yum -y install libevent libevent-devel 




錯誤:configure: error: Please reinstall the mysql distributio 


解決:yum -y install mysql-devel 




錯誤:make: *** [sapi/fpm/php-fpm] error 1 


解決:用make ZEND_EXTRA_LIBS=`-liconv`編譯 




錯誤:configure: error: XML configuration could not be found 


解決:yum -y install libxml2 libxml2-devel 




錯誤:configure: error: No curses/termcap library found 


解決:yum -y install ncurses ncurses-devel 




錯誤:configure: error: xml2-config not found 


解決:yum -y install libxml2 libxml2-devel 




錯誤:configure: error: Cannot find OpenSSL`s <evp.h> 


解決:yum install openssl openssl-devel 




錯誤:configure: error: Please reinstall the libcurl distribution -easy.h should be in <curl-dir>/include/curl/ 


解決:yum install curl curl-devel 




錯誤:configure: error: Cannot find ldap.h 


解決:yum install openldap openldap-devel 




錯誤:configure: error: libjpeg.(aso) not found 


解決:yum install libjpeglibjpeg -devel 




錯誤:configure: error: libpng.(aso) not found. 


解決:yum install libpnglibpng –devel 




錯誤:onfigure: error: freetype.h not found. 


解決:yum install freetype-devel 




錯誤:configure: error: cannot find output from lex; giving up 


解決:yum -y install flex 




錯誤:configure: error: mod_deflate has been requested but can not be built due to prerequisite failures 


解決:yum -y install zlib-devel openssl-devel 




錯誤:Configure: error: Unable to locate gmp.h 


解決:yum install gmp-devel 




錯誤:Configure: error: Cannot find MySQL header files under /usr. 


Note that the MySQL client library is not bundled anymore! 


解決:yum install mysql-devel





更多的補充內容:


安裝php: ./configure 

configure: error: XML configuration could not be found 


yum -y install libxml2 libxml2-devel 


Cannot find OpenSSL`s <evp.h> 

yum install openssl openssl-devel 


1) Configure: error: xml2-config not found. Please check your libxml2 installation. 

#yum install libxml2 libxml2-devel (For RedHat & Fedora) 

# aptitude install libxml2-dev (For Ubuntu) 


2) Checking for pkg-config… /usr/bin/pkg-config 

configure: error: Cannot find OpenSSL`s <evp.h> 

#yum install openssl openssl-devel 


3) Configure: error: Please reinstall the BZip2 distribution 

# yum install bzip2 bzip2-devel 


4) Configure: error: Please reinstall the libcurl distribution – 

easy.h should be in <curl-dir>/include/curl/ 

# yum install curl curl-devel  



5) Configure: error: libjpeg.(also) not found. 

# yum install libjpeg libjpeg-devel 


6) Configure: error: libpng.(also) not found. 

# yum install libpng libpng-devel 


7) Configure: error: freetype.h not found. 

#yum install freetype-devel 


8) Configure: error: Unable to locate gmp.h 

# yum install gmp-devel 


9) Configure: error: Cannot find MySQL header files under /usr. 

Note that the MySQL client library is not bundled anymore! 

# yum install mysql-devel  



10) Configure: error: Please reinstall the ncurses distribution 

# yum install ncurses ncurses-devel 


11) Checking for unixODBC support… configure: error: ODBC header file ‘/usr/include/sqlext.h` not found! 

# yum install unixODBC-devel 


12) Configure: error: Cannot find pspell 

# yum install pspell-devel 


13) configure: error: mcrypt.h not found. Please reinstall libmcrypt. 

# yum install libmcrypt libmcrypt-devel



14) Configure: error: snmp.h not found. Check your SNMP installation. 

# yum install net-snmp net-snmp-devel

本文轉自奇蹟的少年部落格51CTO部落格,原文連結http://blog.51cto.com/raffaelexr/1711783如需轉載請自行聯絡原作者
liliangchun


相關文章