PHP源碼編譯詳解

編譯php包:php-5.4.26.tar.bz2

解壓php-5.4.26.tar.bz2後,進入php解壓目錄:

./configure --prefix=/usr/local/php --enable-fpm --enable-debug --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --enable-mbstring --with-curl --with-mysql=/usr/local/mysql/ --with-mysqli=/usr/local/mysql/bin/mysql_config --with-config-file-path=/usr/local/php/etc

運行後遇到的問題:

error 1

checking for xml2-config path... 
configure: error: xml2-config not found. Please check your libxml2 installation.

(看提示就明白 是一個lib庫沒裝  先用 yum search 名字 看是否能搜到名字 ,找到名字後 把軟件包 開發包裝上)

解決辦法

yum install libxml2-devel.x86_64 -y

error 2

checking for pkg-config... /usr/bin/pkg-config
configure: error: Cannot find OpenSSL's <evp.h>

這是ssl沒裝

解決辦法

 yum  install  openssl-devel.x86_64 -y

error 3

checking for BZip2 in default path... not found
configure: error: Please reinstall the BZip2 distribution

這是bzip2軟件包沒有安裝

解決辦法

yum install bzip2-devel.x86_64 -y

error 4

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

curl和curl庫文件沒有安裝

解決辦法

yum install libcurl.x86_64 libcurl-devel.x86_64 -y

error 5

checking whether to enable JIS-mapped Japanese font support in GD... no
checking for fabsf... yes
checking for floorf... yes
configure: error: jpeglib.h not found

GD庫沒有安裝

解決辦法

yum install libjpeg-devel.x86_64 libpng-devel.x86_64 freetype-devel.x86_64 -y


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章