6、编译安装LAMP之安装PHP

(1) 安装freetype

tar jxvf freetype-2.3.10.tar.bz2
cd freetype-2.3.10
./configure –prefix=/usr/local/freetype
make
make install
cd ..

(2) 安装jpeg

tar zxvf jpegsrc.v7.tar.gz
cd jpeg-7
./configure -prefix=/usr/local/jpeg
make
make install
cd ..

(3) 安装libpng

tar jxvf libpng-1.2.41.tar.bz2
cd libpng-1.2.41
./configure -prefix=/usr/local/libpng
make
make install

(4) 安装GD

① 链接头文件

ls -s /usr/local/libpng/include/pngconf.h /usr/include
ls -s /usr/local/libpng/include/png.h /usr/include

② 安装GD

tar zxvf gd-2.0.35.tar.gz
cd gd-2.0.35
./configure -prefix=/usr/local/gd2 \
--with-freetype=/usr/local/freetype -with-png=/usr/local/libpng \
--with-jpeg=/usr/local/jpeg
make
make install
cd ..

(5) 安装PHP

tar jxvf php-5.2.17.tar.bz2
cd php-5.2.17
./configure -prefix=/usr/local/php \
--with-gd=/usr/local/gd2 --with-apxs2=/usr/local/apache/bin/apxs \
--enable-mbregex --enable-bcmath \
--with-mysql --with-zlib-dir --enable-mbstring=all \
--with-pdo-mysql --with-freetype-dir=/usr/local/freetype --with-jpeg-dir=/usr/local/jpeg \
--with-openssl \
--with-curl
make
make install
cp php.ini-dist /usr/local/php/lib/php.ini
cd ..



















你可能感兴趣的:(6、编译安装LAMP之安装PHP)