【转+修改】Linux php 升级GD, 啃爹!

一、下 

gd-2.0.33.tar.gz 
jpegsrc.v6b.tar.gz 
libpng-1.2.8.tar.tar 
zlib-1.2.3.tar.gz (md5:debc62758716a169df9f62e6ab2bc634)
freetype-2.1.10.tar.gz

二、安装 

1.
安装zlib 
tar zxvf zlib-1.2.3.tar.gz 
cd zlib-1.2.3 
./configure --prefix=/usr/local/zlib
make 
make install 

2.
安装libpng 
tar zxvf libpng-1.2.8.tar.tar 
cd libpng-1.2.8
mv ./scripts/makefile.linux ./makefile 
make 
make install 
注意,里的makefile不是用./configure生成,而是直接从scripts/里拷一个 

3.
安装freetype 
tar zxvf freetype-2.1.10.tar.gz 
cd freetype-2.1.10 
./configure --prefix=/usr/local/freetype
make 
make install 

4.
安装Jpeg 
tar zxvf jpegsrc.v6b.tar.gz 
cd jpeg-6b/ 
./configure --prefix=/usr/local/jpeg6 --enable-shared --enable-static
make
make install
注意,configure一定要--enable-shared参数,不然,不会生成共享 

5.
安装GD 
tar zxvf gd-2.0.33.tar.gz 
cd gd-2.0.33 
./configure --with-png --with-jpeg --with-freetype=/usr/local/freetype
如果报错,看png或者jpeg的路径
 make
make install 

6.
重新编译PHP 

先做个test.php
 
<?
phpinfo();
?>
 
看看以前的编译命令
./configure


tar zxvf php-4.3.9.tar.gz 
cd php-4.3.9 
./configure (
以前的参数) --with-gd --enable-gd-native-ttf --with-zlib-dir=/usr/local/zlib --with-png --with-jpeg --with-freetype-dir=/usr/local/freetype

(这里如果报错。就用)
 ./configure --help | grep png
--with-png-dir[=DIR]      GD: Set the path to libpng install prefix
同理,看所有
然后
类似
#find /usr/ -name png

找了路径,和方法,重新


./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-apxs2=/usr/local/apache2/bin/apxs  --with-gd --enable-gd-native-ttf --with-zlib-dir=/usr/local/zlib --with-png-dir=/usr/local/include/libpng --with-jpeg-dirm=/usr/local/jpeg6 --with-freetype-dir=/usr/local/freetype

/usr/local/apache2/bin/apxs 之前是以前编译选项


make 
make install


cp php.ini-development /etc/php.ini
vim /etc/php.ini
extension=php_gd2.dll



service httpd restart



注意,httpd的端口
cp /usr/local/apache2/bin/apachectl /etc/rc.d/init.d/httpd
vim /etc/rc.d/init.d/httpd

编辑/etc/rc.d/init.d/httpd

#!/bin/bash
#chkconfig:345 61 61 //此行的345参数表示,在哪些运行级别启动,启动序号(S61);关闭序号(K61)

#description:Apache httpd //此行必写,描述服务.

[root@localhost ~]#chmod +x /etc/rc.d/init.d/httpd
[root@localhost ~]# chkconfig --add httpd
[root@localhost ~]# chkconfig --list|grep httpd



啃爹,终于完成了,网上的都乱七八糟。哇哈哈!!!!

可以装个testlink,去官网上找

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值