centos下首次编译安装php5.5整合apache
centos下首次编译安装php5.5整合apache
1.下载php源码 http://www.php.net/get/php-5.5.0.tar.gz/from/tw2.php.net/mirror2.下载freetype 源码包 http://sourceforge.net/projects/freetype/files/freetype2/2.5.0/freetype-2.5.0.tar... |
1.下载php源码
http://www.php.net/get/php-5.5.0.tar.gz/from/tw2.php.net/mirror
2.下载freetype 源码包
http://sourceforge.net/projects/freetype/files/freetype2/2.5.0/freetype-2.5.0.tar.gz
3.下载zlib源码包
http://sourceforge.net/projects/libpng/files/zlib/1.2.7/zlib-1.2.7.tar.bz2
4.下载gd2源码包
https://bitbucket.org/libgd/gd-libgd/downloads/libgd-2.1.0.tar.gz
5.下载libpng源码包
http://download.sourceforge.net/libpng/libpng-1.6.2.tar.gz
6.下载libjpeg源码包
http://www.ijg.org/files/jpegsrc.v9.tar.gz
7.解压并编译安装zlib
./configure --prefix=/usr/local/libpng
make&make install
8.解压并编译安装freetype
./configure --prefix=/usr/local/freetype
9.解压并编译安装libpng
./configure --prefix=/usr/local/libpng
10.连接头文件
ln –s /usr/local/libpng/include/pngconf.h /usr/include
ln –s /usr/local/libpng/include/png.h /usr/include
11.解压并编译安装gd2
./configure --with-freetype=/usr/local/freetype --with-zlib=/usr/local/zlib --with-png=/usr/local/libpng --with-jpeg=/usr/local/jpeg --prefix=/usr/local/gd2
12.解压并编译安装php
./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=/usr/local/zlib --enable-mbstring=all --with-pdo-mysql --with-freetype-dir=/usr/local/freetype --with-jpeg-dir=/usr/local/jpeg --with-png-dir=/usr/local/libpng --with-xpm-dir=/usr/local/xpm --with-openssl--with-curl
13.cp php.ini-dist /usr/local/php/lib/php.ini
14.vim httpd.conf
<IfModule mime_module><IfModule>之间插入行:AddType application/x-httpd-php .php
15.最后编写<?phpinfo();?>检查
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
*补充下载xpm http://xorg.freedesktop.org/releases/individual/lib/libXpm-3.5.5.tar.gz 并且编译安装或者yum -y install *Xpm*
目录 返回
首页