php 5.3 gd,linux5.4+PHP5.3.3+GD2.0.35+扩展篇.docx

linux5.4+PHP5.3.3+GD2.0.35+扩展篇.docx

Smle 版权所有 联系方式QQ317362607

以下内容都是本人亲身实践得来的经验,如果有误请联系我,加以改正,互相学习~

Smile

2010-9-24

承接上一篇 linux5.4+resin4.0.14+jdk1.6篇.docx

1、 安装前的准备工作

1:下载需要的包

GD:需要

gd :gd-2.0.35

freetype :freetype-2.4.2

libxml : libxml2-2.6.32    PHP5只支持libxml2-2.5.10以上版本

libpng: libpng-1.4.3

zlib : zlib-1.2.5

jpeg : jpegsrc.v6b

PHP:

php : php-5.3.3 官方很多

扩展:

Libmcrypt-2.5.8.tar.bz2

Mcrypt-2.6.8.tar.gz.gz

Mhash-0.9.9.9.tar.bz2

Blitz-0.6.10.tar.gz.gz

建立初始目录:

mkdir /usr/local/modules

jpeg目录

mkdir /usr/local/modules/jpeg6

mkdir /usr/local/modules/jpeg6/bin

mkdir /usr/local/modules/jpeg6/lib

mkdir /usr/local/modules/jpeg6/include

mkdir /usr/local/modules/jpeg6/man

mkdir /usr/local/modules/jpeg6/man/man1

2、 解压安装DG相关

安装libxml

tar -zxvf libxml2-2.6.32.tar.gz libxml2.6.32

cd libxml2.6.23

./configure --prefix /usr/local/libxml2.6

make

make install

等吧~~~~

完成后移除解压文件

rm libxml2-2.6.32.tar.gz

rm –rf libxml2.6.32

安装zlib

tar -zxvf zlib-1.2.2.tar.gz

cd zlib-1.2.2

#不要用--prefix自定义安装目录,影响gd的安装

./configure

make

make install

安装freetype

tar xzvf freetype-2.1.5.tar.gz

cd freetype-2.1.5

./configure --prefix=/usr/local/modules/freetype

make

make install

安装libpng

tar xzvf libpng-1.2.5.tar.gz

#不要用--prefix自定义安装目录,影响gd的安装

cd libpng-1.2.5

cp scripts/makefile.std makefile

make

make install

安装jpeg

tar xzvf jpegsrc.v6b.tar.gz

./configure --prefix=/usr/local/modules/jpeg6 --enable-shared --enable-static

make

make install

tar -zxvf gd-2.0.35.tar.gz

./configure --prefix=/usr/local/modules/gd --with-jpeg=/usr/local/modules/jpeg6 --with-png --with-zlib --with-freetype=/usr/local/modules/freetype

make

make install

安装imap:

tar -zxvf imap-2007e.tar.gz

mv imap-2007e /usr/local/

cd /usr/local/imap-2007e

make lr5 SSLTYPE=unix.nopwd

mkdir include

mkdir lib

cp c-client/*.h include/

cp c-client/*.c lib/

cp c-client/c-client.a lib/libc-client.a

OK GD 的相关(imap除外,PHP扩展)都已经安装好了,可以进行下一步了

3、 安装php

tar -zxvf php-5.3.3.tar.gz

配置文件里面的参数比较多最好看仔细了再安装否则,可能要从新安装,这个过程很慢~~

./configure --prefix=/usr/local/php5 --with-mysql=/usr/local/mysql --with-apxs2=/usr/local/apache/bin/apxs --with-libxml-dir=/usr/local/libxml-2.6 --with-gd=/usr/local/modules/gd --with-jpeg-dir=/usr/local/modules/jpeg6 --with-zlib --with-png-dir --with-freetype-dir=/usr/local/modules/freetype --with-imap=/usr/local/imap-2007e --with-config-file-path=/usr/local/php5/etc --enable-ftp --enable-magic-quotes --enable-sockets --enable-calendar   --enable-dba --enable-json   --enable-gd-jis-conv   --enable-mbstring --enable-soap   --enable-sqlite-utf8 --enable-zip

make

make test

make install

安装好以后

cd /usr/local/php-5.3.3

cp php.ini-development /usr/local/php5/etc/php.ini

好啦!这个文件就是php的配置文件啦!OK 修改一下

cd /usr/local/php5/lib/

vi php.ini

查找safe_mode=Off,更改为safe_mode=On

(1)查找max_execution_time = 30,更改为max_execution_time = 600

(2)查找max_input_time = 60,更改为max_input_time = 600

(4)查找display_errors = On,更改为display_errors = Off

(5)查找register_globals = Off,更改为register_globals = On

(6)查找post_max_size = 8M,更改为post_max_size = 20M

(7)查找upload_max_filesize = 2M,更改为upload_max_filesize = 20M

(8)查找session.auto_start = 0,更改为session.auto_start = 1

修改之后 保存退出

再来更改 httpd.conf

vi /usr/local/apache/conf/httpd.conf

找到这一行

添加 :

AddType application/x-httpd-php .php

AddType application/x-httpd-php .php3

AddType application/x-httpd-php .phtml

AddType application/x-httpd-php-source .phps

再找到这一行: 在DirectoryIndex 里面添加如下没有的文件名称

保存退出

4、 安装zendOptimizer3.3.0a.tar.gz

cd /usr/local

tar –zxvf ZendOptimizer-3.3.0a-linux-glibc21-i386.tar.gz.gz

cd ZendOptimizer-3.3.0a-linux-glibc21-i386

./install.sh

安装时填php配置路径为

/usr/local/php5/etc

很简单!OK

测试 vi /var/www/index.php

Phpinfo();

?>

显示了一个警告,没关系安装它的不够更改就好了

更改文件 php.ini

vi  /usr/local/php5/etc/php.ini

找到如下timezone 未设定值 那就按照他的提示设置

更改后  一定要去掉 前面的分号 ;

我是广东就选择上海了。

重启  apache 刷新 页面  不行的话重启系统 本人就是重启系统才生效的

date_default_timezone_set ( 'Asia/Shanghai' );

未完待续…… 保存下

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
For documentation, browse index.html. Quick install guide: If the sources have been fetched from CVS, run bootstrap.sh [options]. From a released source, use: 1. Type './configure' 2. Type 'make install' Generic configuration instructions are in the file INSTALL. The following 3rd-party libraries will be used by gd if found by configure. While gd will compile and install even without these, we suggest that at least zlib and libpng are installed, and recommend that freetype and jpeg are installed as well: 1. zlib, available from http://www.gzip.org/zlib/ Data compression library 2. libpng, available from http://www.libpng.org/pub/png/ Portable Network Graphics library; requires zlib 3. FreeType 2.x, available from http://www.freetype.org/ Free, high-quality, and portable font engine 4. JPEG library, available from http://www.ijg.org/ Portable JPEG compression/decompression library 5. XPM, available from http://koala.ilog.fr/lehors/xpm.html X Pixmap library If any of these libraries are installed, but not detected by configure, you can use the following command line options: --with-png=DIR Without the DIR argument, configure will check for png header files and libraries in a default location. To switch off png support, use --without-png, or --with-png=no. If the DIR argument is specified, configure tries to find the png header files in DIR/include, and the libraries in DIR/lib. To accommodate OpenBSD ports, DIR/include/libpng is also checked if necessary. --with-freetype=DIR Dto. for freetype 2.x library. The search path for include files is DIR/include/freetype2. --with-jpeg=DIR Dto. for jpeg library. --with-xpm=DIR Dto. for xpm library.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值