如何解決checking if the location of ZLIB install directory is defined... no 問題
1.情況說明:在用源碼安裝php5,在編譯的時(shí)候出現(xiàn)錯(cuò)誤:checking if the location of ZLIB install directory is defined... no ; configure: error: Cannot find libz.
2.這是由于我們沒有安裝zlib導(dǎo)致的,只要到官網(wǎng)中下載和編譯安裝即可:
(1) http://www.tjdsmy.cn/ 下載zlib源碼。這里下載版本zlib-1.2.7.tar.gz,解壓到/usr/src,執(zhí)行命令#tar -zxvf zlib-1.2.7.tar.gz -C /usr/src
(2)進(jìn)入目錄/usr/src/zlib-1.2.7/,執(zhí)行命令:
# ./configure --prefix=/usr/local/zlib
#make && make install
(3)進(jìn)入到php目錄中重新編譯,如果沒有參數(shù)zlib可以增加參數(shù):
--with-zlib-dir=/usr/local/zlib