centos7yum安装php7

yum安装php7.1

源码包安装请查看 centos7.2源码编译安装LNMP  ,因需要编译速度较慢,所以有时候选择yum安装。

安装php源:

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm 
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

检查源是否安装成功;

yum repolist enabled | grep "webtatic*"

安装php扩展源:

yum -y install php71w php71w-fpm
yum -y install php71w-mbstring php71w-common php71w-gd php71w-mcrypt
yum -y install php71w-mysql php71w-xml php71w-cli php71w-devel
yum -y install php71w-pecl-memcached php71w-pecl-redis php71w-opcache

验证php7.1.x和扩展是否安装成功 :

验证php是否安装成功:

php -v

验证对应的扩展是否安装成功:

php -m

设置php-fpm并检测php-fpm的运行状态:

启动php-fpm

service php-fpm start

检查启动是否成功:

service php-fpm status

设置开机自启动:

systemctl enable php-fpm.service

检查开机自启动是否设置成功:

systemctl list-dependencies | grep php-fpm
ps -ef | grep php-fpm

 

© 版权声明
THE END
喜欢就支持一下吧
点赞0赞赏
分享
评论 抢沙发