3.源码安装 php5.3
1)安装 php 所需的图形 lib 库
php 程序在开发时会调用一些诸如画图所需的库,(网站有的需要图形如验证码、图形库等),大概如下:
zlib libxml libjpeg freetype libpng gd curl libiconv zlib-devel libxml2-devel libjpeg freetype-devel
libpng-devel gd-devel curl-devel
[root@localhost scripts]# cd
[root@localhost ~]# mkdir /php
rz 上传 php5.3 和各依赖包
[root@localhost ~]# ls /php/
libiconv-1.14.tar.gz libmcrypt-2.5.8.tar.gz mhash-0.9.9.9.tar.gz php-5.3.27.tar.gz
[root@localhost ~]# cd /php/
[root@localhost php]# yum -y install zlib libxml libjpeg freetype libpng gd curl zlib-devel
libxml2-devel libjpeg-turbo-devel freetype-devel libpng-devel gd-devel curl-devel
[root@localhost php]# rpm -qa zlib libxml libjpeg freetype libpng gd curl zlib-devel libxml2-devel
libjpeg-turbo-devel freetype-devel libpng-devel gd-devel curl-devel
gd-devel-2.0.35-11.el6.x86_64
libjpeg-turbo-devel-1.2.1-3.el6_5.x86_64
libxml2-devel-2.7.6-21.el6_8.1.x86_64
libpng-1.2.49-2.el6_7.x86_64
gd-2.0.35-11.el6.x86_64
zlib-devel-1.2.3-29.el6.x86_64
zlib-1.2.3-29.el6.x86_64
libpng-devel-1.2.49-2.el6_7.x86_64
freetype-2.3.11-17.el6.x86_64
curl-7.19.7-53.el6_9.x86_64
freetype-devel-2.3.11-17.el6.x86_64
2)安装 php 普通依赖包
[root@localhost php]# yum -y install libxslt*
[root@localhost php]# yum -y install openldap openldap-devel
[root@localhost php]# cp -frp /usr/lib64/libldap* /usr/lib/
[root@localhost php]# ls
libiconv-1.14.tar.gz libmcrypt-2.5.8.tar.gz mhash-0.9.9.9.tar.gz php-5.3.27.tar.gz
3)源码安装 php3 个依赖包
[root@localhost php]# tar -zxf mhash-0.9.9.9.tar.gz
[root@localhost php]# tar -zxf libiconv-1.14.tar.gz
[root@localhost php]# tar -zxf libmcrypt-2.5.8.tar.gz
[root@localhost php]# ls
libiconv-1.14 libiconv-1.14.tar.gz libmcrypt-2.5.8 libmcrypt-2.5.8.tar.gz mhash-0.9.9.9
mhash-0.9.9.9.tar.gz php-5.3.27.tar.gz
[root@localhost php]# cd mhash-0.9.9.9
[root@localhost mhash-0.9.9.9]# ls
acinclude.m4 ChangeLog config.sub CVS include libtool mhash-0.9.9 NEWS THANKS
aclocal.m4 changelog-update.sh configure CYGWIN-PATCHES INSTALL ltmain.sh mhash.spec README TODO
AUTHORS config.guess configure.in depcomp install-sh Makefile.am mhash.spec.in src win32
buildconf config.status COPYING doc lib Makefile.in missing stamp-h1
[root@localhost mhash-0.9.9.9]# ./configure
[root@localhost mhash-0.9.9.9]# make && make install
[root@localhost mhash-0.9.9.9]# cd ..
[root@localhost php]# cd libiconv-1.14
[root@localhost libiconv-1.14]# ls
ABOUT-NLS build-aux configure.ac DESIGN gnulib-local lib Makefile.in os2 README srclib tools
aclocal.m4 ChangeLog COPYING djgpp HACKING libcharset man po README.djgpp srcm4 windows
AUTHORS config.h.in COPYING.LIB doc include m4 NEWS PORTS README.woe32 tests woe32dll
autogen.sh configure DEPENDENCIES extras INSTALL.generic Makefile.devel NOTES preload src THANKS
[root@localhost libiconv-1.14]# ./configure
[root@localhost libiconv-1.14]# make && make install
[root@localhost libiconv-1.14]# cd ..
[root@localhost php]# cd libmcrypt-2.5.8
[root@localhost libmcrypt-2.5.8]# ls
acinclude.m4 buildconf config.log COPYING.LIB install-sh libmcrypt.spec.in Makefile.in README
aclocal.m4 ChangeLog config.status depcomp KNOWN-BUGS libtool missing src
AUTHORS config.guess config.sub doc lib ltmain.sh mkinstalldirs stamp-h1
autom4te.cache config.h configure include libltdl Makefile modules THANKS
autoscan.log config.h.in configure.in INSTALL libmcrypt.spec Makefile.am NEWS TODO
[root@localhost libmcrypt-2.5.8]# ./configure
[root@localhost libmcrypt-2.5.8]# make && make install
[root@localhost libmcrypt-2.5.8]# cd libltdl/
[root@localhost libltdl]# ls
acinclude.m4 aclocal.m4 config-h.in configure configure.in COPYING.LIB ltdl.c ltdl.h Makefile.am Makefile.in README
[root@localhost libltdl]# ./configure --enable-ltdl-install
[root@localhost libltdl]# make && make install
[root@localhost libltdl]# cd
[root@localhost ~]# ldconfig -v |grep mhash
空
[root@localhost ~]# ls /usr/local/lib
charset.alias libcharset.so.1 libiconv.so.2 libmcrypt libmcrypt.so.4.4.8
libmhash.so.2
libcharset.a libcharset.so.1.0.0 libiconv.so.2.5.1 libmcrypt.la libmhash.a
libmhash.so.2.0.1
libcharset.la libiconv.la libltdl.a libmcrypt.so libmhash.la
preloadable_libiconv.so
libcharset.so libiconv.so libltdl.la libmcrypt.so.4 libmhash.so
[root@localhost ~]# ln -s /usr/local/lib/libmhash.* /usr/lib
[root@localhost ~]# ln -s /usr/local/lib/libmcrypt* /usr/lib
[root@localhost ~]# ln -s /usr/local/lib/libiconv.* /usr/lib
[root@localhost ~]# ln -s /application/mysql/lib/libmysqlclient.so.18 /usr/lib64/