How to upgrade PHP on CentOS Web Server

 To upgrade PHP on CentOS Web Server, you can follow these steps:

  1. Login to your server as root user via SSH.
  2. Run the following command to update the system's packages yum update
  1. Install the Remi repository, which provides updated versions of PHP for CentOS:

yum install -y https://rpms.remirepo.net/enterprise/remi-release-7.rpm

Note: Replace 7 with your CentOS version if you are using a different version.

  1. Once the Remi repository is installed, enable the PHP 7.x repository by running:
yum-config-manager --enable remi-php7
  1. Now, you can install the latest version of PHP 7 by running:
yum install -y php

6. Verify that the new version of PHP has been installed by running:

php  -v
This will display the installed version of PHP on your system.
  1. Restart the web server to apply the changes by running:
service httpd restart

That's it! Your Cent OS server should now be running the latest version of PHP

Comments