PHP -v # PHP 7.1.33 (cli) (built: Oct 31 2019 17:36:04) ( NTS ) # copyright (c) 1997-2018 The PHP Group # Zend Engine v3.1.0, copyright (c) 1998-2018 Zend Technologies # with Zend OPcache v7.1.33, copyright (c) 1999-2018, by Zend Technologies # with Xdebug v2.5.5, copyright (c) 2002-2017, by Derick Rethans
2.安装 PHP7.3 和相关的扩展
yum install -y PHP73.x86_64 PHP73-fpm.x86_64 yum install -y \ PHP73-bcmath.x86_64 \ PHP73-devel.x86_64 \ PHP73-gd.x86_64 \ PHP73-gmp.x86_64 \ PHP73-imap.x86_64 \ PHP73-json.x86_64 \ PHP73-mbstring.x86_64 \ PHP73-MysqLnd.x86_64 \ PHP73-opcache.x86_64 \ PHP73-pdo.x86_64 \ PHP73-process.x86_64 \ PHP73-soap.x86_64 \ PHP73-xml.x86_64
3.修改默认的 PHP 版本
update-alternatives --set PHP /usr/bin/PHP-7.3
4.查看 PHP 版本
PHP -v # PHP 7.3.30 (cli) (built: Oct 6 2021 20:34:22) ( NTS ) # copyright (c) 1997-2018 The PHP Group # Zend Engine v3.3.30, copyright (c) 1998-2018 Zend Technologies # with Zend OPcache v7.3.30, copyright (c) 1999-2018, by Zend Technologies
5.安装第三方扩展
# 安装 pecl 工具 wget http://pear.PHP.net/go-pear.phar PHP go-pear.phar yum install -y ImageMagick-devel libmemcached-devel libzstd-devel pecl install xdebug igbinary imagick memcached redis # /etc/PHP-7.3.ini 增加以下内容 zend_extension=/usr/lib64/PHP/7.3/modules/xdebug.so extension=igbinary.so extension=imagick.so extension=memcached.so # /etc/PHP-7.3.d/20-redis.ini 增加以下内容 extension=redis.so
6.重启 PHP-fpm
service restart PHP-fpm # systemctl restart PHP-fpm
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。