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/

版权声明:
作者:Joe.Ye
链接:https://www.appblog.cn/index.php/2023/02/25/install-and-config-php-7-under-centos/
来源:APP全栈技术分享
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
打赏
海报
CentOS下安装配置PHP 7
安装编译环境 # yum install wget gcc gcc-c++ g++ autoconf autoconf2.13 automake make m4 安装配置PHP # yum install openssl openssl-devel python-devel……
<<上一篇
下一篇>>
文章目录
关闭
目 录