linux环境下yum安装php详细过程

发布于2019-11-27  321次阅读


1.打开网址:https://ius.io/setup

2.安装源:
yum install \
https://repo.ius.io/ius-release-el7.rpm \
https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

3.清除yum缓存
yum clean all

3.查看yum php7.2的源列表
yum list|grep php72

4.导出结果列表
yum list|grep php72 > php72_list.txt

5.从列表去除一些不用的源插件安装
yum install php72u-bcmath.x86_64 php72u-cli.x86_64 php72u-common.x86_64 php72u-devel.x86_64 php72u-embedded.x86_64 php72u-enchant.x86_64 php72u-fpm.x86_64 php72u-gd.x86_64 php72u-gmp.x86_64 php72u-imap.x86_64 php72u-interbase.x86_64 php72u-intl.x86_64 php72u-json.x86_64 php72u-ldap.x86_64 php72u-mbstring.x86_64 php72u-mysqlnd.x86_64 php72u-odbc.x86_64 php72u-opcache.x86_64 php72u-pdo.x86_64 php72u-pecl-amqp.x86_64 php72u-pecl-geoip.x86_64 php72u-pecl-igbinary.x86_64 php72u-pecl-igbinary-devel.x86_64 php72u-pecl-imagick.x86_64 php72u-pecl-imagick-devel.x86_64 php72u-pecl-mongodb.x86_64 php72u-pecl-redis.x86_64 php72u-process.x86_64 php72u-pspell.x86_64 php72u-recode.x86_64 php72u-snmp.x86_64 php72u-soap.x86_64 php72u-sodium.x86_64 php72u-tidy.x86_64 php72u-xml.x86_64 php72u-xmlrpc.x86_64

6.安装成功,查看版本
php-v

7.启动php
systemctl start php-fpm.service

8.修改php的运行用户组跟nginx一致
vim /etc/php-fpm.d/www.conf

注释之前的运行用户和组
; user = php-fpm
; group = php-fpm
添加上新的运行用户和组
user = nobody
group = nobody

9.重启php查询运行用户组
systemctl stop php-fpm.service
systemctl start php-fpm.service

ps -ef | grep php

完成


  • 微信或支付宝

道,可道,非常道;名,可名,非常名。