brief description
I installed the LNMP environment once before , and the tutorial used PHP7.3 at that time. However, in subsequent use, it is found that PHP7.4 has more application scenarios, so it is necessary to upgrade PHP
- For the configuration scheme of installing PHP before, you can refer to [Server Management] to manually deploy the LNMP environment (CentOS 8) (non-Aliyun version)
- If the following solutions cannot solve your problem, you can refer to the above documents to see where the configuration differences are
Upgrade PHP
- Execute the following command to install php 7.4
dnf module reset php
dnf module install php:7.4
- Check if the installation is successful
[root@Sean ~]# php -v
PHP 7.4.19 (cli) (built: May 4 2021 11:06:37) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.19, Copyright (c), by Zend Technologies
-
Restoring the configuration file, this will vary from person to person. Mainly check the following files
/etc/php.ini
,/etc/php-fpm.d/www.conf
, but generally there will be no changes. -
restart service
systemctl restart php-fpm