centos 编译 php5.6,CentOS 编译安装php5.6

提前安装准备

yum groupinstall "development tools"

安装 libevent

安装libmcrypt

继续安装一些依赖软件

yum install -y gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libpng libpng-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses curl curl-devel openssl-devel gdbm-devel db4-devel libXpm-devel libX11-devel gd-devel gmp-devel readline-devel libxslt-devel expat-devel xmlrpc-c xmlrpc-c-devel openssl openssl-devel bzip2 bzip2-devel  curl curl-devel

Config 配置

./configure  --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --enable-fpm  --with-curl  --with-openssl  --enable-mbregex  --with-mysql  --with-mysqli  --with-mysql-sock  --enable-pdo  --with-pdo-mysql  --with-pdo-sqlite  --enable-mysqlnd  --with-gd  --enable-gd-native-ttf  --enable-exif  --with-jpeg-dir=/usr/local/jpeg  --with-png-dir=/usr/local/png  --with-freetype-dir=/usr/local/freetype  --enable-gd-jis-conv  --with-gettext  --with-zlib  --enable-zip  --with-bz2  --disable-fileinfo  --enable-xmlreader  --enable-xmlwriter  --with-xmlrpc  --enable-mbstring  --enable-inline-optimization --enable-sockets  --with-mcrypt --with-mhash --enable-pcntl

make && make install

复制配置文件

cp php.ini-development /usr/local/php/lib/php.ini

修改时区

date.timezone =Asia/Shanghai

另行编译扩展

cd ext/sockets

/usr/local/php/bin/phpize

./configure --prefix=/usr/local/php/lib --with-php-config=/usr/local/php/bin/php-config --enable-sockets

make && make install

将PHP加入系统环境变量

vim /etc/profile

在文件结束位置添加

export PATH=$PATH:/usr/local/php/bin/:/usr/local/php/sbin/

保存文件

最后执行命令 : source /etc/profile 重新加载环境

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值