- Add the Remi repository to your system:
sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm sudo yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
- Enable the Remi repository for PHP 7.4:
sudo yum-config-manager --enable remi-php74
- Install PHP 7.4:
sudo yum install php
- If you have any PHP modules installed, you will need to reinstall them for PHP 7.4. You can do this by running the following command:
sudo yum install <module-name>
<module-name> with the name of the PHP module you want to install (e.g.
- Update your PHP scripts to use the new version of PHP. This may involve updating any PHP code that uses deprecated functions or features, or making changes to configuration files such as
- Restart your web server to apply the changes. For example, if you are using Apache, you can restart the server with the following command:
sudo systemctl restart httpd
That’s it! You have now updated PHP from version 7.2 to 7.4 on CentOS.