PHP安裝:
wget http://cn2.php.net/distributions/php-5.3.28.tar.gz
tar zxf php-5.3.28.tar.gz
cd php-5.3.28
./configure --prefix=/usr/local/php
--with-apxs2=/usr/local/apache2/bin/apxs
--with-
config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-libxml-dir
--with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-
zlib-dir --with-bz2 --with-openssl --with-mcrypt --enable-soap --enable-gd-native-ttf
--enable-mbstring --enable-sockets --enable-exif --disable-ipv6
make && make install
報錯一:configure: error: xml2-config not found. Please check your libxml2 installation.
原因:缺少libxm文件
解決方法:yum -y install libxml2*
【轉(zhuǎn)載】重裝mysql+apache+php,configure php的時候得到錯誤信息
shell#./configure --with-mysql=/usr/lib/mysql--with-apxs2=/usr/local/apache/bin/apxs
--prefix=/usr/local/php
configure: error: xml2-config not
found. Please check your libxml2 installation.
錯誤原因,xml2-config這個文件沒找到。
/*原因可能出在我這次安裝redhat,有很多東西沒選上,所以出此問題。*/
根據(jù)錯誤提示,安裝libxml2。RHEL_5.2的安裝光盤上提供了很多rpm包,我的是dvd光盤,位置在/media/RHEL_5.2
i386 DVD/Server,
cd /media/RHEL_5.2 i386 DVD/Server
ls *libxml*
[root@localhost Server]# ls *libxml*
libxml2-2.6.26-2.1.2.1.i386.rpm libxml2-python-2.6.26-2.1.2.1.i386.rpm
libxml2-devel-2.6.26-2.1.2.1.i386.rpm perl-libxml-perl-0.08-1.2.1.noarch.rpm
[root@localhost Server]# rpm -ivh
libxml2-python-2.6.26-2.1.2.1.i386.rpm
warning:
libxml2-python-2.6.26-2.1.2.1.i386.rpm: Header V3
DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
package
libxml2-python-2.6.26-2.1.2.1 is already installed /*提示我已經(jīng)安裝過了*/
[root@localhost Server]# rpm -ivh
libxml2-devel-2.6.26-2.1.2.1.i386.rpm
warning:
libxml2-devel-2.6.26-2.1.2.1.i386.rpm: Header V3
DSA signature: NOKEY, key ID 37017186
error: Failed dependencies:
zlib-devel is needed by
libxml2-devel-2.6.26-2.1.2.1.i386
[root@localhost Server]# ls *zlib-devel*
zlib-devel-1.2.3-3.i386.rpm
[root@localhost Server]# rpm -ivh zlib-devel-1.2.3-3.i386.rpm
warning:
zlib-devel-1.2.3-3.i386.rpm: Header V3 DSA
signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
1:zlib-devel ########################################### [100%]
[root@localhost Server]# rpm -ivh
libxml2-devel-2.6.26-2.1.2.1.i386.rpm
warning:
libxml2-devel-2.6.26-2.1.2.1.i386.rpm: Header V3
DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
1:libxml2-devel ########################################### [100%]
[root@localhost Server]#
好了,沒有問題了,
make
make install
安裝完成
報錯二:configure: error: Cannot find OpenSSL's
因為缺少openssl-dev 文件
yum -y install openssl-dev
報錯三:configure: error: Please reinstall the BZip2 distribution
缺少安裝bzip2或者bzip2-devel
查看哪些軟件已安裝:rpm -qa,后接可指定查找的軟件
yum -y install bzip2-devel
報錯四:configure: error: jpeglib.h not found.
缺少libjpeg庫文件
yum install libpng.x86_64 freetype.x86_64 libpng-devel.x86_64 freetype-devel.x86_64 -y
yum install -y libjpeg.x86_64 libjpeg-devel.x86_64
報錯五:onfigure: error: mcrypt.h not found. Please reinstall libmcrypt.
libmcrypt庫沒有安裝
【轉(zhuǎn)載】今天在編譯php的時候,出現(xiàn)如下錯誤php安裝出錯:configure: error: mcrypt.h not found. Please reinstall libmcrypt.,意思是,沒有查找到mcrytp.h,需要安裝libcrytp,在下面的地址下載libmarypt:
wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/attic/libmcrypt/libmcrypt-2.5.7.tar.gz
安裝:
66 tar -zxvf libmcrypt-2.5.7.tar.gz
67 cd libmcrypt-2.5.7
68 mkdir -p /usr/local/libmcrytp
69 ./configure prefix=/usr/local/libmcrytp/
70 make
71 make install
==========================================================
如果以上方法仍然不能安裝,請參考:
rpm -ivh "http://www.lishiming.net/data/p_w_upload/forum/month_1211/epel-release-6-7.noarch.rpm"
yum install -y libmcrypt-devel
因為centos6.x 默認的yum源沒有l(wèi)ibmcrypt-devel 這個包,只能借助第三方y(tǒng)um源。
問題6:Thank you for using PHP.
Notice: Following unknown configure options were used:
--enable-gd-native-tff
Check './configure --help' for available options
原因PHP編譯完成,但是提示--enable-gd-native-tff選項是無效的,可以不予理會
通過./configure --help |grep *gd-native*查看該選項意思
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機、免備案服務(wù)器”等云主機租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。