centos7升级php7丨技术开发分享录

centos7升级php7

{{ detail.nickname }}

转载 翻译 {{ formatTime(detail.create_time) }} 字数 {{ detail.content && detail.content.length }} 阅读 {{ detail.read_num }} {{ formatTag(v) }}

"**1、检查已安装php**\n\n```shell\n> yum list installed | grep php\nphp.x86_64                         5.4.16-48.el7                  @base\nphp-cli.x86_64                     5.4.16-48.el7                  @base\nphp-common.x86_64                  5.4.16-48.el7                  @base\nphp-gd.x86_64                      5.4.16-48.el7                  @base\nphp-imap.x86_64                    5.4.16-9.el7                   @epel\nphp-ldap.x86_64                    5.4.16-48.el7                  @base\nphp-mysql.x86_64                   5.4.16-48.el7                  @base\nphp-odbc.x86_64                    5.4.16-48.el7                  @base\nphp-pdo.x86_64                     5.4.16-48.el7                  @base\nphp-pear.noarch                    1:1.9.4-22.el7                 @base\nphp-process.x86_64                 5.4.16-48.el7                  @base\nphp-xml.x86_64                     5.4.16-48.el7                  @base\nphp-xmlrpc.x86_64                  5.4.16-48.el7                  @base\n```\n\n**2、删除旧版php**\n\n```shell\n> yum remove php\n> yum remove php-*\n```\n\n**3、安装php7.x的yum源**\n\n```shell\n> rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm\n> rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm\n```\n\n**4、安装php**\n\n```shell\n> yum install -y php71w php71w-cli php71w-common php71w-devel php71w-embedded php71w-fpm php71w-gd php71w-mbstring php71w-mysqlnd php71w-opcache php71w-pdo php71w-xml php71w-ldap php71w-mcrypt\n```\n\n**5、查看php版本**\n\n```shell\n> php -v\nPHP 7.1.33 (cli) (built: Oct 26 2019 10:16:23) ( NTS )\nCopyright (c) 1997-2018 The PHP Group\nZend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies\n    with Zend OPcache v7.1.33, Copyright (c) 1999-2018, by Zend Technologies\n```\n\n**6、重启服务生效**\n\n```shell\n> systemctl restart httpd.service\n```"
PS:写作不易,如要转裁,请标明转载出处。

如果此篇对您有帮助,可小额赞助,以兹鼓励!

猜你想看