CentOS下安装配置PHP 7

安装编译环境

# yum install wget gcc gcc-c++ g++ autoconf autoconf2.13 automake make m4

安装配置PHP

# yum install openssl openssl-devel python-devel libxml2 libxml2-devel zlib-devel pcre-devel libcurl-devel libjpeg-devel libpng-devel libpng12-devel freetype-devel mhash-devel libmcrypt-devel libXpm-devel libedit-devel re2c libxslt libxslt-devel libicu-devel

# wget http://php.net/distributions/php-7.1.16.tar.gz
# tar -zxf php-7.1.16.tar.gz
# cd php-7.1.16
# ./configure --prefix=/data/server/php7 \
--with-config-file-path=/data/server/php7/etc \
--enable-fpm \
--with-fpm-user=www \
--with-fpm-group=www \
--enable-bcmath \
--with-pdo_sqlite \
--with-gettext \
--with-iconv \
--enable-ftp \
--with-sqlite3 \
--enable-xml \
--enable-mbstring \
--enable-sockets \
--enable-zip \
--enable-soap \
--enable-fileinfo \
--enable-exif \
--with-readline \
--with-libedit \
--with-openssl \
--with-zlib \
--with-curl \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--with-freetype-dir \
--with-libxml-dir \
--with-xpm-dir \
--with-mcrypt \
--with-mhash \
--enable-mysqlnd \
--enable-pdo \
--with-mysqli \
--with-pdo-mysql \
--without-pear \
--with-libdir=lib64 \
--with-mysql-sock \
--enable-opcache \
--enable-fastcgi \
--enable-intl \
--with-xsl \
--disable-cgi
# make
# make install
# cd /data/server/php7/etc/
# cp php-fpm.conf.default php-fpm.conf
# cp php-fpm.d/www.conf.default php-fpm.d/www.conf
# ln -s /data/server/php7/bin/* /usr/bin/
# ln -s /data/server/php7/sbin/* /usr/bin/
# php -v

el6(CentOS 6)手动安装依赖

libicu-devel: https://pkgs.org/download/libicu-devel

# rpm -ivh libicu-devel-4.2.1-14.el6.x86_64.rpm

libmcrypt: https://pkgs.org/download/libmcrypt

# rpm -ivh libmcrypt-2.5.8-9.el6.x86_64.rpm

libmcrypt-devel: https://pkgs.org/download/libmcrypt-devel

# rpm -ivh libmcrypt-devel-2.5.8-9.el6.x86_64.rpm

libedit-devel: https://pkgs.org/download/libedit-devel

# yum install ncurses-devel
# rpm -ivh libedit-devel-2.11-4.20080712cvs.1.el6.x86_64.rpm

国内镜像

http://mirrors.ustc.edu.cn/epel/6/x86_64/Packages/l/
http://mirrors.hust.edu.cn/epel/6/x86_64/Packages/l/

上一篇 CentOS下安装配置VsFTP
下一篇 使用yum搭建LNMP环境
目录
文章列表
1 uni-app完整实战
uni-app完整实战
2
Android使用Glide加载View背景图片
Android使用Glide加载View背景图片
3
Vue项目中使用stylus(.styl文件)
Vue项目中使用stylus(.styl文件)
4
Redis 集合(Set)
Redis 集合(Set)
5
Spring Cloud Gray 微服务灰度中间件
Spring Cloud Gray 微服务灰度中间件
最新评论
一位WordPress评论者
一位WordPress评论者
2月12日
您好,这是一条评论。若需要审核、编辑或删除评论,请访问仪表盘的评论界面。评论者头像来自 Gravatar。