首页 > CentOS > CentOS编译安装PHP

CentOS编译安装PHP

来源:原创 作者:thomas 分类:CentOS 阅读:984 日期:2014-05-22

下载PHP源码包

http://us3.php.net/downloads.php

十日谈技术博客

安装各种第三方包

yum install bison flex libxml2-devel openssl-devel bzip2-devel libcurl-devel libjpeg-devel libpng-devel  freetype-devel  t1lib-devel libicu-devel

#安装libiconv(解压过程略)

wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz

./configure

make

make install

#安装mhash(解压过程略) PHP的mhash模块使用

wget http://nchc.dl.sourceforge.net/project/mhash/mhash/0.9.9.9/mhash-0.9.9.9.tar.bz2

./configure

make

make install

#安装libmcrypt(解压过程略) PHP的mcrypt模块使用

wget http://nchc.dl.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz

./configure

make

make install

解压缩并开始配置,编译,安装

cp php-5.3.27.tar.gz /usr/local/src/

tar xzvf php-5.3.27.tar.gz

cd php-5.3.27

mkdir -p /usr/local/php

./configure --prefix=/usr/local/php --disable-ipv6 --enable-exif --enable-fpm --enable-ftp --enable-gd-native-ttf --enable-intl --enable-mbstring --enable-mod-charset --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-zip --enable-maintainer-zts --with-bz2 --with-config-file-path=/usr/local/php/etc --with-curl --with-freetype-dir --with-jpeg-dir --with-gd --with-gettext --with-mhash --with-iconv-dir --with-libxml-dir --with-mcrypt --with-mysql --with-mysql-sock --with-mysqli --with-openssl-dir --with-openssl --with-pcre-dir --with-pcre-regex --with-pdo-mysql --with-png-dir --with-pear --with-t1lib --with-zlib

make && make install

复制php.ini

在当前源码目录下

ll php.ini*

-rw-r--r--. 1 101 101 69606 7月  11 01:43 php.ini-development

-rw-r--r--. 1 101 101 69627 7月  11 01:43 php.ini-production

复制其中一个到

cp php.ini-production /usr/local/php/etc/php.ini

 

热门文章 更多>

微信扫一扫,关注技术十日谈