PHP安装,报错信息和解决过程
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*
【转载】重装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,有很多东西没选上,所以出此问题。*/
根据错误提示,安装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 /*提示我已经安装过了*/
[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-develis 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库没有安装
【转载】今天在编译php的时候,出现如下错误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源没有libmcrypt-devel 这个包,只能借助第三方yum源。
问题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*查看该选项意思
文章题目:PHP安装,报错信息和解决过程
文章出自:http://scyanting.com/article/pojcpe.html