如何将CentOS7系统升级LAMP环境并更新到最新PHP版本?

2026-04-01 09:051阅读0评论SEO问题
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计1906个文字,预计阅读时间需要8分钟。

如何将CentOS7系统升级LAMP环境并更新到最新PHP版本?

本例介绍了在CentOS 7系统上搭建LAMP环境及更新PHP版本的步骤。以下是一般流程,方便大家参考:

1. 搭建LAMP环境 - 使用yum安装Apache和MySQL: [root@localhost ~]# yum install httpd mysql-server - 启动Apache服务: [root@localhost ~]# systemctl start httpd - 设置Apache服务开机自启: [root@localhost ~]# systemctl enable httpd - 安装PHP及相关模块: [root@localhost ~]# yum install php php-mysqlnd - 重启Apache服务以应用配置: [root@localhost ~]# systemctl restart httpd

2. 更新PHP版本 - 安装EPEL仓库: [root@localhost ~]# yum install epel-release - 安装php70w(以PHP 7.0为例): [root@localhost ~]# yum install php70w php70w-fpm php70w-mysqlnd - 配置php-fpm(以php70w为例): [root@localhost ~]# vi /etc/php/7.0/fpm/pool.d/www.conf - 设置监听端口和用户组: listen=/run/php/php7.0-fpm.sock user=apache group=apache - 重启php-fpm服务: [root@localhost ~]# systemctl restart php-fpm - 设置php-fpm开机自启: [root@localhost ~]# systemctl enable php-fpm

以上步骤仅供参考,具体操作可能因实际环境而异。

本文实例讲述了CentOS7系统搭建LAMP及更新PHP版本操作。分享给大家供大家参考,具体如下:

搭建LAMP环境 用yum安装

安装Apache
  1. 安装Apache

[root@localhost /]# yum install dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm [root@localhost /]# rpm -Uvh mirror.webtatic.com/yum/el7/webtatic-release.rpm

  1. 查看yum源中有没有php7.x

[root@localhost /]# yum search php7 Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile epel/x86_64/metalink | 5.9 kB 00:00:00 * base: mirrors.aliyun.com * epel: my.mirrors.thegigabit.com * extras: mirrors.cn99.com * updates: mirrors.163.com * webtatic: uk.repo.webtatic.com epel | 5.4 kB 00:00:00 webtatic | 3.6 kB 00:00:00 (1/5): epel/x86_64/group_gz | 90 kB 00:00:01 (2/5): webtatic/x86_64/group_gz | 448 B 00:00:04 (3/5): epel/x86_64/primary_db | 6.9 MB 00:00:06 (4/5): epel/x86_64/updateinfo | 1.0 MB 00:00:10 (5/5): webtatic/x86_64/primary_db | 232 kB 00:00:14 ============================================================= N/S matched: php7 ============================================================= mod_php71w.x86_64 : PHP module for the Apache HTTP Server mod_php72w.x86_64 : PHP module for the Apache HTTP Server php70w.x86_64 : PHP scripting language for creating dynamic web sites php70w-bcmath.x86_64 : A module for PHP applications for using the bcmath library php70w-cli.x86_64 : Command-line interface for PHP php70w-common.x86_64 : Common files for PHP php70w-dba.x86_64 : A database abstraction layer module for PHP applications php70w-devel.x86_64 : Files needed for building PHP extensions php70w-embedded.x86_64 : PHP library for embedding in applications php70w-enchant.x86_64 : Enchant spelling extension for PHP applications php70w-fpm.x86_64 : PHP FastCGI Process Manager php70w-gd.x86_64 : A module for PHP applications for using the gd graphics library php70w-imap.x86_64 : A module for PHP applications that use IMAP php70w-interbase.x86_64 : A module for PHP applications that use Interbase/Firebird databases php70w-intl.x86_64 : Internationalization extension for PHP applications php70w-ldap.x86_64 : A module for PHP applications that use LDAP php70w-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling php70w-mcrypt.x86_64 : Standard PHP module provides mcrypt library support php70w-mysql.x86_64 : A module for PHP applications that use MySQL databases php70w-mysqlnd.x86_64 : A module for PHP applications that use MySQL databases php70w-odbc.x86_64 : A module for PHP applications that use ODBC databases php70w-opcache.x86_64 : An opcode cache Zend extension php70w-pdo.x86_64 : A database access abstraction module for PHP applications php70w-pdo_dblib.x86_64 : MSSQL database module for PHP php70w-pear.noarch : PHP Extension and Application Repository framework php70w-pecl-apcu.x86_64 : APCu - APC User Cache php70w-pecl-apcu-devel.x86_64 : APCu developer files (header) php70w-pecl-geoip.x86_64 : Extension to map IP addresses to geographic places php70w-pecl-igbinary.x86_64 : Replacement for the standard PHP serializer php70w-pecl-igbinary-devel.x86_64 : Igbinary developer files (header) php70w-pecl-imagick.x86_64 : Provides a wrapper to the ImageMagick library php70w-pecl-imagick-devel.x86_64 : Imagick developer files (header) php70w-pecl-memcached.x86_64 : Extension to work with the Memcached caching daemon php70w-pecl-mongodb.x86_64 : PECL package MongoDB driver php70w-pecl-redis.x86_64 : Extension for communicating with the Redis key-value store php70w-pecl-xdebug.x86_64 : PECL package for debugging PHP scripts php70w-pgsql.x86_64 : A PostgreSQL database module for PHP php70w-phpdbg.x86_64 : Interactive PHP debugger php70w-process.x86_64 : Modules for PHP script using system process interfaces php70w-pspell.x86_64 : A module for PHP applications for using pspell interfaces php70w-recode.x86_64 : A module for PHP applications for using the recode library php70w-snmp.x86_64 : A module for PHP applications that query SNMP-managed devices php70w-soap.x86_64 : A module for PHP applications that use the SOAP protocol php70w-tidy.x86_64 : Standard PHP module provides tidy library support php70w-xml.x86_64 : A module for PHP applications which use XML php70w-xmlrpc.x86_64 : A module for PHP applications which use the XML-RPC protocol php71w-bcmath.x86_64 : A module for PHP applications for using the bcmath library php71w-cli.x86_64 : Command-line interface for PHP php71w-common.x86_64 : Common files for PHP php71w-dba.x86_64 : A database abstraction layer module for PHP applications php71w-devel.x86_64 : Files needed for building PHP extensions php71w-embedded.x86_64 : PHP library for embedding in applications php71w-enchant.x86_64 : Enchant spelling extension for PHP applications php71w-fpm.x86_64 : PHP FastCGI Process Manager php71w-gd.x86_64 : A module for PHP applications for using the gd graphics library php71w-imap.x86_64 : A module for PHP applications that use IMAP php71w-interbase.x86_64 : A module for PHP applications that use Interbase/Firebird databases php71w-intl.x86_64 : Internationalization extension for PHP applications php71w-ldap.x86_64 : A module for PHP applications that use LDAP php71w-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling php71w-mcrypt.x86_64 : Standard PHP module provides mcrypt library support php71w-mysql.x86_64 : A module for PHP applications that use MySQL databases php71w-mysqlnd.x86_64 : A module for PHP applications that use MySQL databases php71w-odbc.x86_64 : A module for PHP applications that use ODBC databases php71w-opcache.x86_64 : An opcode cache Zend extension php71w-pdo.x86_64 : A database access abstraction module for PHP applications php71w-pdo_dblib.x86_64 : MSSQL database module for PHP php71w-pear.noarch : PHP Extension and Application Repository framework php71w-pecl-apcu.x86_64 : APCu - APC User Cache php71w-pecl-apcu-devel.x86_64 : APCu developer files (header) php71w-pecl-geoip.x86_64 : Extension to map IP addresses to geographic places php71w-pecl-igbinary.x86_64 : Replacement for the standard PHP serializer php71w-pecl-igbinary-devel.x86_64 : Igbinary developer files (header) php71w-pecl-imagick.x86_64 : Provides a wrapper to the ImageMagick library php71w-pecl-imagick-devel.x86_64 : Imagick developer files (header) php71w-pecl-memcached.x86_64 : Extension to work with the Memcached caching daemon php71w-pecl-mongodb.x86_64 : PECL package MongoDB driver php71w-pecl-redis.x86_64 : Extension for communicating with the Redis key-value store php71w-pecl-xdebug.x86_64 : PECL package for debugging PHP scripts php71w-pgsql.x86_64 : A PostgreSQL database module for PHP php71w-phpdbg.x86_64 : Interactive PHP debugger php71w-process.x86_64 : Modules for PHP script using system process interfaces php71w-pspell.x86_64 : A module for PHP applications for using pspell interfaces php71w-recode.x86_64 : A module for PHP applications for using the recode library php71w-snmp.x86_64 : A module for PHP applications that query SNMP-managed devices php71w-soap.x86_64 : A module for PHP applications that use the SOAP protocol php71w-tidy.x86_64 : Standard PHP module provides tidy library support php71w-xml.x86_64 : A module for PHP applications which use XML php71w-xmlrpc.x86_64 : A module for PHP applications which use the XML-RPC protocol php72w-bcmath.x86_64 : A module for PHP applications for using the bcmath library php72w-cli.x86_64 : Command-line interface for PHP php72w-common.x86_64 : Common files for PHP php72w-dba.x86_64 : A database abstraction layer module for PHP applications php72w-devel.x86_64 : Files needed for building PHP extensions php72w-embedded.x86_64 : PHP library for embedding in applications php72w-enchant.x86_64 : Enchant spelling extension for PHP applications php72w-fpm.x86_64 : PHP FastCGI Process Manager php72w-gd.x86_64 : A module for PHP applications for using the gd graphics library php72w-imap.x86_64 : A module for PHP applications that use IMAP php72w-interbase.x86_64 : A module for PHP applications that use Interbase/Firebird databases php72w-intl.x86_64 : Internationalization extension for PHP applications php72w-ldap.x86_64 : A module for PHP applications that use LDAP php72w-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling php72w-mysql.x86_64 : A module for PHP applications that use MySQL databases php72w-mysqlnd.x86_64 : A module for PHP applications that use MySQL databases php72w-odbc.x86_64 : A module for PHP applications that use ODBC databases php72w-opcache.x86_64 : An opcode cache Zend extension php72w-pdo.x86_64 : A database access abstraction module for PHP applications php72w-pdo_dblib.x86_64 : MSSQL database module for PHP php72w-pear.noarch : PHP Extension and Application Repository framework php72w-pecl-apcu.x86_64 : APCu - APC User Cache php72w-pecl-apcu-devel.x86_64 : APCu developer files (header) php72w-pecl-geoip.x86_64 : Extension to map IP addresses to geographic places php72w-pecl-igbinary.x86_64 : Replacement for the standard PHP serializer php72w-pecl-igbinary-devel.x86_64 : Igbinary developer files (header) php72w-pecl-imagick.x86_64 : Provides a wrapper to the ImageMagick library php72w-pecl-imagick-devel.x86_64 : Imagick developer files (header) php72w-pecl-libsodium.x86_64 : Wrapper for the Sodium cryptographic library php72w-pecl-memcached.x86_64 : Extension to work with the Memcached caching daemon php72w-pecl-mongodb.x86_64 : PECL package MongoDB driver php72w-pecl-redis.x86_64 : Extension for communicating with the Redis key-value store php72w-pecl-xdebug.x86_64 : PECL package for debugging PHP scripts php72w-pgsql.x86_64 : A PostgreSQL database module for PHP php72w-phpdbg.x86_64 : Interactive PHP debugger php72w-process.x86_64 : Modules for PHP script using system process interfaces php72w-pspell.x86_64 : A module for PHP applications for using pspell interfaces php72w-recode.x86_64 : A module for PHP applications for using the recode library php72w-snmp.x86_64 : A module for PHP applications that query SNMP-managed devices php72w-soap.x86_64 : A module for PHP applications that use the SOAP protocol php72w-sodium.x86_64 : Wrapper for the Sodium cryptographic library php72w-tidy.x86_64 : Standard PHP module provides tidy library support php72w-xml.x86_64 : A module for PHP applications which use XML php72w-xmlrpc.x86_64 : A module for PHP applications which use the XML-RPC protocol Name and summary matches only, use "search all" for everything.

  1. yum 安装php72w和各种拓展,选自己需要的即可:

[root@localhost /]# yum -y install php72w php72w-cli php72w-common php72w-devel php72w-embedded php72w-fpm php72w-gd php72w-mbstring php72w-mysqlnd php72w-opcache php72w-pdo php72w-xml php72w-pear

  1. 完成安装 , 查看PHP版本

[root@localhost /]# php -v

  1. 重启服务器

[root@localhost /]# systemctl restart httpd

希望本文所述对大家centos系统配置有所帮助。

如何将CentOS7系统升级LAMP环境并更新到最新PHP版本?

本文共计1906个文字,预计阅读时间需要8分钟。

如何将CentOS7系统升级LAMP环境并更新到最新PHP版本?

本例介绍了在CentOS 7系统上搭建LAMP环境及更新PHP版本的步骤。以下是一般流程,方便大家参考:

1. 搭建LAMP环境 - 使用yum安装Apache和MySQL: [root@localhost ~]# yum install httpd mysql-server - 启动Apache服务: [root@localhost ~]# systemctl start httpd - 设置Apache服务开机自启: [root@localhost ~]# systemctl enable httpd - 安装PHP及相关模块: [root@localhost ~]# yum install php php-mysqlnd - 重启Apache服务以应用配置: [root@localhost ~]# systemctl restart httpd

2. 更新PHP版本 - 安装EPEL仓库: [root@localhost ~]# yum install epel-release - 安装php70w(以PHP 7.0为例): [root@localhost ~]# yum install php70w php70w-fpm php70w-mysqlnd - 配置php-fpm(以php70w为例): [root@localhost ~]# vi /etc/php/7.0/fpm/pool.d/www.conf - 设置监听端口和用户组: listen=/run/php/php7.0-fpm.sock user=apache group=apache - 重启php-fpm服务: [root@localhost ~]# systemctl restart php-fpm - 设置php-fpm开机自启: [root@localhost ~]# systemctl enable php-fpm

以上步骤仅供参考,具体操作可能因实际环境而异。

本文实例讲述了CentOS7系统搭建LAMP及更新PHP版本操作。分享给大家供大家参考,具体如下:

搭建LAMP环境 用yum安装

安装Apache
  1. 安装Apache

[root@localhost /]# yum install dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm [root@localhost /]# rpm -Uvh mirror.webtatic.com/yum/el7/webtatic-release.rpm

  1. 查看yum源中有没有php7.x

[root@localhost /]# yum search php7 Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile epel/x86_64/metalink | 5.9 kB 00:00:00 * base: mirrors.aliyun.com * epel: my.mirrors.thegigabit.com * extras: mirrors.cn99.com * updates: mirrors.163.com * webtatic: uk.repo.webtatic.com epel | 5.4 kB 00:00:00 webtatic | 3.6 kB 00:00:00 (1/5): epel/x86_64/group_gz | 90 kB 00:00:01 (2/5): webtatic/x86_64/group_gz | 448 B 00:00:04 (3/5): epel/x86_64/primary_db | 6.9 MB 00:00:06 (4/5): epel/x86_64/updateinfo | 1.0 MB 00:00:10 (5/5): webtatic/x86_64/primary_db | 232 kB 00:00:14 ============================================================= N/S matched: php7 ============================================================= mod_php71w.x86_64 : PHP module for the Apache HTTP Server mod_php72w.x86_64 : PHP module for the Apache HTTP Server php70w.x86_64 : PHP scripting language for creating dynamic web sites php70w-bcmath.x86_64 : A module for PHP applications for using the bcmath library php70w-cli.x86_64 : Command-line interface for PHP php70w-common.x86_64 : Common files for PHP php70w-dba.x86_64 : A database abstraction layer module for PHP applications php70w-devel.x86_64 : Files needed for building PHP extensions php70w-embedded.x86_64 : PHP library for embedding in applications php70w-enchant.x86_64 : Enchant spelling extension for PHP applications php70w-fpm.x86_64 : PHP FastCGI Process Manager php70w-gd.x86_64 : A module for PHP applications for using the gd graphics library php70w-imap.x86_64 : A module for PHP applications that use IMAP php70w-interbase.x86_64 : A module for PHP applications that use Interbase/Firebird databases php70w-intl.x86_64 : Internationalization extension for PHP applications php70w-ldap.x86_64 : A module for PHP applications that use LDAP php70w-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling php70w-mcrypt.x86_64 : Standard PHP module provides mcrypt library support php70w-mysql.x86_64 : A module for PHP applications that use MySQL databases php70w-mysqlnd.x86_64 : A module for PHP applications that use MySQL databases php70w-odbc.x86_64 : A module for PHP applications that use ODBC databases php70w-opcache.x86_64 : An opcode cache Zend extension php70w-pdo.x86_64 : A database access abstraction module for PHP applications php70w-pdo_dblib.x86_64 : MSSQL database module for PHP php70w-pear.noarch : PHP Extension and Application Repository framework php70w-pecl-apcu.x86_64 : APCu - APC User Cache php70w-pecl-apcu-devel.x86_64 : APCu developer files (header) php70w-pecl-geoip.x86_64 : Extension to map IP addresses to geographic places php70w-pecl-igbinary.x86_64 : Replacement for the standard PHP serializer php70w-pecl-igbinary-devel.x86_64 : Igbinary developer files (header) php70w-pecl-imagick.x86_64 : Provides a wrapper to the ImageMagick library php70w-pecl-imagick-devel.x86_64 : Imagick developer files (header) php70w-pecl-memcached.x86_64 : Extension to work with the Memcached caching daemon php70w-pecl-mongodb.x86_64 : PECL package MongoDB driver php70w-pecl-redis.x86_64 : Extension for communicating with the Redis key-value store php70w-pecl-xdebug.x86_64 : PECL package for debugging PHP scripts php70w-pgsql.x86_64 : A PostgreSQL database module for PHP php70w-phpdbg.x86_64 : Interactive PHP debugger php70w-process.x86_64 : Modules for PHP script using system process interfaces php70w-pspell.x86_64 : A module for PHP applications for using pspell interfaces php70w-recode.x86_64 : A module for PHP applications for using the recode library php70w-snmp.x86_64 : A module for PHP applications that query SNMP-managed devices php70w-soap.x86_64 : A module for PHP applications that use the SOAP protocol php70w-tidy.x86_64 : Standard PHP module provides tidy library support php70w-xml.x86_64 : A module for PHP applications which use XML php70w-xmlrpc.x86_64 : A module for PHP applications which use the XML-RPC protocol php71w-bcmath.x86_64 : A module for PHP applications for using the bcmath library php71w-cli.x86_64 : Command-line interface for PHP php71w-common.x86_64 : Common files for PHP php71w-dba.x86_64 : A database abstraction layer module for PHP applications php71w-devel.x86_64 : Files needed for building PHP extensions php71w-embedded.x86_64 : PHP library for embedding in applications php71w-enchant.x86_64 : Enchant spelling extension for PHP applications php71w-fpm.x86_64 : PHP FastCGI Process Manager php71w-gd.x86_64 : A module for PHP applications for using the gd graphics library php71w-imap.x86_64 : A module for PHP applications that use IMAP php71w-interbase.x86_64 : A module for PHP applications that use Interbase/Firebird databases php71w-intl.x86_64 : Internationalization extension for PHP applications php71w-ldap.x86_64 : A module for PHP applications that use LDAP php71w-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling php71w-mcrypt.x86_64 : Standard PHP module provides mcrypt library support php71w-mysql.x86_64 : A module for PHP applications that use MySQL databases php71w-mysqlnd.x86_64 : A module for PHP applications that use MySQL databases php71w-odbc.x86_64 : A module for PHP applications that use ODBC databases php71w-opcache.x86_64 : An opcode cache Zend extension php71w-pdo.x86_64 : A database access abstraction module for PHP applications php71w-pdo_dblib.x86_64 : MSSQL database module for PHP php71w-pear.noarch : PHP Extension and Application Repository framework php71w-pecl-apcu.x86_64 : APCu - APC User Cache php71w-pecl-apcu-devel.x86_64 : APCu developer files (header) php71w-pecl-geoip.x86_64 : Extension to map IP addresses to geographic places php71w-pecl-igbinary.x86_64 : Replacement for the standard PHP serializer php71w-pecl-igbinary-devel.x86_64 : Igbinary developer files (header) php71w-pecl-imagick.x86_64 : Provides a wrapper to the ImageMagick library php71w-pecl-imagick-devel.x86_64 : Imagick developer files (header) php71w-pecl-memcached.x86_64 : Extension to work with the Memcached caching daemon php71w-pecl-mongodb.x86_64 : PECL package MongoDB driver php71w-pecl-redis.x86_64 : Extension for communicating with the Redis key-value store php71w-pecl-xdebug.x86_64 : PECL package for debugging PHP scripts php71w-pgsql.x86_64 : A PostgreSQL database module for PHP php71w-phpdbg.x86_64 : Interactive PHP debugger php71w-process.x86_64 : Modules for PHP script using system process interfaces php71w-pspell.x86_64 : A module for PHP applications for using pspell interfaces php71w-recode.x86_64 : A module for PHP applications for using the recode library php71w-snmp.x86_64 : A module for PHP applications that query SNMP-managed devices php71w-soap.x86_64 : A module for PHP applications that use the SOAP protocol php71w-tidy.x86_64 : Standard PHP module provides tidy library support php71w-xml.x86_64 : A module for PHP applications which use XML php71w-xmlrpc.x86_64 : A module for PHP applications which use the XML-RPC protocol php72w-bcmath.x86_64 : A module for PHP applications for using the bcmath library php72w-cli.x86_64 : Command-line interface for PHP php72w-common.x86_64 : Common files for PHP php72w-dba.x86_64 : A database abstraction layer module for PHP applications php72w-devel.x86_64 : Files needed for building PHP extensions php72w-embedded.x86_64 : PHP library for embedding in applications php72w-enchant.x86_64 : Enchant spelling extension for PHP applications php72w-fpm.x86_64 : PHP FastCGI Process Manager php72w-gd.x86_64 : A module for PHP applications for using the gd graphics library php72w-imap.x86_64 : A module for PHP applications that use IMAP php72w-interbase.x86_64 : A module for PHP applications that use Interbase/Firebird databases php72w-intl.x86_64 : Internationalization extension for PHP applications php72w-ldap.x86_64 : A module for PHP applications that use LDAP php72w-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling php72w-mysql.x86_64 : A module for PHP applications that use MySQL databases php72w-mysqlnd.x86_64 : A module for PHP applications that use MySQL databases php72w-odbc.x86_64 : A module for PHP applications that use ODBC databases php72w-opcache.x86_64 : An opcode cache Zend extension php72w-pdo.x86_64 : A database access abstraction module for PHP applications php72w-pdo_dblib.x86_64 : MSSQL database module for PHP php72w-pear.noarch : PHP Extension and Application Repository framework php72w-pecl-apcu.x86_64 : APCu - APC User Cache php72w-pecl-apcu-devel.x86_64 : APCu developer files (header) php72w-pecl-geoip.x86_64 : Extension to map IP addresses to geographic places php72w-pecl-igbinary.x86_64 : Replacement for the standard PHP serializer php72w-pecl-igbinary-devel.x86_64 : Igbinary developer files (header) php72w-pecl-imagick.x86_64 : Provides a wrapper to the ImageMagick library php72w-pecl-imagick-devel.x86_64 : Imagick developer files (header) php72w-pecl-libsodium.x86_64 : Wrapper for the Sodium cryptographic library php72w-pecl-memcached.x86_64 : Extension to work with the Memcached caching daemon php72w-pecl-mongodb.x86_64 : PECL package MongoDB driver php72w-pecl-redis.x86_64 : Extension for communicating with the Redis key-value store php72w-pecl-xdebug.x86_64 : PECL package for debugging PHP scripts php72w-pgsql.x86_64 : A PostgreSQL database module for PHP php72w-phpdbg.x86_64 : Interactive PHP debugger php72w-process.x86_64 : Modules for PHP script using system process interfaces php72w-pspell.x86_64 : A module for PHP applications for using pspell interfaces php72w-recode.x86_64 : A module for PHP applications for using the recode library php72w-snmp.x86_64 : A module for PHP applications that query SNMP-managed devices php72w-soap.x86_64 : A module for PHP applications that use the SOAP protocol php72w-sodium.x86_64 : Wrapper for the Sodium cryptographic library php72w-tidy.x86_64 : Standard PHP module provides tidy library support php72w-xml.x86_64 : A module for PHP applications which use XML php72w-xmlrpc.x86_64 : A module for PHP applications which use the XML-RPC protocol Name and summary matches only, use "search all" for everything.

  1. yum 安装php72w和各种拓展,选自己需要的即可:

[root@localhost /]# yum -y install php72w php72w-cli php72w-common php72w-devel php72w-embedded php72w-fpm php72w-gd php72w-mbstring php72w-mysqlnd php72w-opcache php72w-pdo php72w-xml php72w-pear

  1. 完成安装 , 查看PHP版本

[root@localhost /]# php -v

  1. 重启服务器

[root@localhost /]# systemctl restart httpd

希望本文所述对大家centos系统配置有所帮助。

如何将CentOS7系统升级LAMP环境并更新到最新PHP版本?