数码鹭岛论坛
标题:
linux中升级php和GD库笔记
[打印本页]
作者:
翔子
时间:
2008-9-26 17:38
标题:
linux中升级php和GD库笔记
linux中升级php和GD库笔记
php-5.1.2.tar.gz
安装php所需的软件包: (其中libxml2是安装php5必须的,为什么还需要perl呆会说明原因。)
libxml2-2.6.19.tar.gz
libxslt-1.1.15.tar.gz
ActivePerl-5.8.8.817-i686-linux-2.2.17-gcc-257965.rpm
curl-7.15.0.tar.gz
GD库所需要软件包(有人说PHP源码包里自带了GD2.0.28和zlib,只要安装GD的三个支持包:jpg,png和freetype,但是我们还是下载)
gd-2.0.33.tar.gz
freetype-2.1.10.tar.gz
jpegsrc.v6b.tar.gz
libpng-1.2.8.tar.gz
zlib-1.2.3.tar.gz
//安装jpeg
[root@as4 local]# mkdir -p /usr/local/jpeg6
[root@as4 local]# mkdir -p /usr/local/jpeg6/bin
[root@as4 local]# mkdir -p /usr/local/jpeg6/lib
[root@as4 local]# mkdir -p /usr/local/jpeg6/include
[root@as4 local]# mkdir -p /usr/local/jpeg6/man
[root@as4 local]# mkdir -p /usr/local/jpeg6/man1
[root@as4 local]# mkdir -p /usr/local/jpeg6/man/man1
# tar -zvxf jpegsrc.v6b.tar.gz
# cd jpeg-6b
# ./configure --prefix= /usr/local/jpeg6/ --enable-shared --enable-static
# make; make install
b. 安装libpng
# cd ..
# tar -zvxf libpng-1.2.8.tar.gz
# cd libpng-1.2.8
# cp scripts/makefile.std makefile
# make; make install
c. 安装 freetype
# cd ..
# tar -zvxf freetype-2.1.10.tar.gz
# cd freetype-2.1.10
# mkdir -p /usr/local/freetype
# ./configure --prefix=/usr/local/freetype
# make;make install
d.: 安装zlib
# cd ..
#tar -zxvf zlib-1.2.3.tar.gz
#cd zlib.1.2.3
# ./configure
# make;make install
e.安装GD库
# cd ..
# tar -zvxf gd-2.0.33.tar.gz
# mkdir -p /usr/local/gd2
# cd gd-2.0.33
# ./configure --prefix=/usr/local/gd2--with-jpeg=/usr/local/jpeg6/ --with-png=/usr/local/lib/--with-zlib=/usr/local/lib/ --with-freetype=/usr/local/freetype/
# make; make install
e.安装Curl库
# cd ..
# tar -zxvf curl-7.15.0.tar.gz
# mkdir -p /usr/local/curl
# ./configure --prefix=/usr/local/curl
# make; make install
五:安装php5,php5必须有libxml2支持!
a.安装libxml2
# cd ..
# tar -zxf libxml2-2.6.19.tar.gz
# cd libxml2-2.6.19
# mkdir -p /usr/local/libxml2
# ./configure --prefix=/usr/local/libxml2
# make; make install
b.安装 libxslt(可选安装,你可以不安装)
# cd ..
# tar -zxf libxslt-1.1.15.tar.gz
# mkdir -p /usr/local/libxslt
# cd libxslt-1.1.15
# ./configure --prefix=/usr/local/libxslt --with-libxml-prefix=/usr/local/libxml2
# make; make install
c.安装php5
# cd ..
# tar -zvxf php-5.1.2.tar.gz
# mkdir -p /usr/local/php
# cd php-5.05
# ./configure --prefix=/usr/local/php5--with-apxs2=/usr/local/apache/bin/apxs--with-mysql=/usr/local/mysql522 --with-curl=/usr/local/curl--enable-ftp --with-libxml-dir=/usr/local/libxml2--with-expat-dir=/usr/lib --enable-soap --with-gd=/usr/local/gd2/--with-jpeg-dir=/usr/local/jpeg6/ --with-zlib-dir=/usr/local/lib/--with-png=/usr/local/lib/ --with-freetype-dir=/usr/local/freetype/
# make
# make install
# cp php.ini-dist /usr/local/php/lib/php.ini
在PHP5.2的编译的过程中,如果遇到
checking for MySQL support... yes
checking for specified location of the MySQL UNIX socket... no
checking for MySQL UNIX socket location... no
configure: error: Cannot find libmysqlclient_r under /usr/local/mysql.
Note that the MySQL client library is not bundled anymore!
那么,你需要注意了,你可能在编译APACHE的时候,使用--with-mpm模块,请在编译MYSQL的时候加上 --enable-thread-safe-client.
这是PHP5.2的一个改进,在PHP5.2.0之前的版本都不需要MYSQL启用安全线程。
-----------------------------
APACHE 的configure
./configure --prefix=/usr/local/apache --enable-module=so--with-mpm=worker --enable-ssl --enable-deflate --enable-cern---enable-expires --enable-headers --enable-vhost-alias --enable-rewrite--enable-access --enable-auth --enable-include --enable-log_config--enable-env --enable-setenvif --enable-http --enable-mime--enable-status --enable-autoindex --enable-asis --enable-cgi--enable-negotiation --enable-dir --enable-actions --enable-userdir--enable-alias -enable-mem-cache --enable-cache --enable-headers--enable-deflate
---------------------------------------
MYSQL的configure
./configure prefix=/usr/local/mysql --with-extra-charsets=all --enable-thread-safe-client
-----------------------------------
PHP5.2的congifure
./configure --with-apxs2=/usr/local/apache/bin/apxs --enable-ftp--enable-magic-quotes --enable-track-vars --enable-sockets--with-gettext --with-gd --with-zlib-dir=/usr/local--with-freetype-dir=/usr/local --enable-soap--with-mysqli=/usr/local/mysql/bin/mysql_config --with-xmlrpc--with-imap=/usr/local/src/imap-2004g --enable-mbstring=all--with-mime-magic=/usr/share/misc/magic.mime --with-mcrypt --with-iconv--enable-mbregex --enable-mime-magic --with-openssl=/usr/local/ssl--with-imap-ssl --with-mysql=/usr/local/mysql
欢迎光临 数码鹭岛论坛 (http://www.clore.net/forum/)
Powered by Discuz! X3.2