当前位置: 编程技术>php
linux下php gd 库的安装步骤
来源: 互联网 发布时间:2014-10-11
本文导语: 一,先安装支持包(注意安装顺序) 1、安装zlib 代码示例: tar xzvf zlib-1.2.3.tar.gz cd zlib-1.2.3 ./configure make make install 2、安装freetype 代码示例: tar xzvf freetype-2.2.1.tar.gz cd freetype-2.2.1 ./configure make make install 3、安装libpng ...
一,先安装支持包(注意安装顺序)
1、安装zlib
代码示例:
tar xzvf zlib-1.2.3.tar.gz
cd zlib-1.2.3
./configure
make
make install
cd zlib-1.2.3
./configure
make
make install
2、安装freetype
代码示例:
tar xzvf freetype-2.2.1.tar.gz
cd freetype-2.2.1
./configure
make
make install
cd freetype-2.2.1
./configure
make
make install
3、安装libpng
代码示例:
tar xzvf libpng-1.2.12.tar.gz
cd libpng-1.2.12
cp scripts/makefile.std makefile
make test
make install
cd libpng-1.2.12
cp scripts/makefile.std makefile
make test
make install
4、安装jpeg
建立文件包:/usr/local/man/man1
代码示例:
tar xzvf jpegsrc.v6b.tar.gz
./configure --enable-shared --enable-static
make
make install
./configure --enable-shared --enable-static
make
make install
注意,如果安装PHP5,必需安装libxml2
5、安装GD库
代码示例:
tar xzvf gd-2.0.18.tar.gz
./configure --with-jpeg --with-png --with-zlib --with-freetype
make
make install
./configure --with-jpeg --with-png --with-zlib --with-freetype
make
make install
二,更改apache的配置文件:
让apache能解释php程序。
1,查找AddType application/x-tar .tgz 行,在下面添加:
代码示例:
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
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .phtml
AddType application/x-httpd-php-source .phps
2,找到下面一行在后面添加:index.php,表示网站的默认页也允许为index.php
代码示例:
DirectoryIndex index.html index.html.var index.php