605   PHP RedHat

环境参数:
redhat 5.5 x86_x64;
php 5.6.8
nginx

需要安装的依赖包:
freetype-2.4.0.tar.bz2;
jpegsrc.v9.tar.gz;
libpng-1.2.50.tar.gz

1,安装freetype

wget "http://download.savannah.gnu.org/releases/freetype/freetype-2.4.0.tar.bz2" 
tar jxvf freetype-2.4.0.tar.bz2
cd freetype-2.4.0
./configure --prefix=/usr/local/freetype 
make 
make install

2,安装jpegsrc

wget "http://www.ijg.org/files/jpegsrc.v9.tar.gz" 
tar zxvf jpegsrc.v9.tar.gz
cd jpeg-9
./configure --prefix=/usr/local/jpeg 
make 
make install

3,安装libpng

wget "http://downloads.sourceforge.net/project/libpng/libpng12/1.2.50/libpng-1.2.50.tar.gz?r=http%3A%2F%2Fwww.libpng.org%2Fpub%2Fpng%2Flibpng.html&ts=1376631135&use_mirror=nchc"  
tar zxvf libpng-1.2.50.tar.gz
cd libpng-1.2.50 
./configure --prefix=/usr/local/libpng
make
make install

安装完依赖包,开始安装gd扩展

1,进入php5.5的源码的扩展目录,找到gd

# cd gd
# /usr/local/php/bin/phpize
# ./configure --with-php-config=/usr/local/php/bin/php-config  --with-jpeg-dir=/usr/local/jpeg  --with-png-dir=/usr/local/libpng   --with-freetype-dir=/usr/local/freetype
# make
# make install

2,将生产的扩展gd.so放到php的扩展库里

# cp modules/gd.so /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226

3,修改php.ini文件,增加gd.so

extension=pdo_mysql.so

4,重启服务,包括php-fpm和nginx

[root@v0A-123-177-206 PDO_MYSQL-1.0.2]# service php-fpm restart
Restarting php-fpm daemon: php-fpm.
[root@v0A-123-177-206 PDO_MYSQL-1.0.2]# service nginx restart
Stopping nginx:                                            [  OK  ]
Starting nginx:                                            [  OK  ]

5,打开phpinfo()

QQ图片20151123092436



Leave a Reply

Your email address will not be published. Required fields are marked *