This guide will show you how to install or upgrade to latest release of PHP on Fedora, RHEL and CentOS.
For installing specific php version, type one of the below command:
For CentOS/RHEL 7, you can install default version of php with below command:
For installing specific php version, type below command:
For CentOS/RHEL 6, you can install default version of php with below command:
For installing specific php version, type one of below command:
For Fedora, you can install any version of php with below command:
For installing default php version, type below command:
For installing specific php version, type one of the below command:
We hope this guide was helpful.
Note: On CentOS/RHEL 8, yum command has been replaced with dnf and in near future yum package manager will be discontinued. It is now recommended to use dnf for installing packages on CentOS/RHEL 8 but if you still wish to use yum you can use it.
Adding EPEL/Remi Repository
If you are on Fedora, standards repositories are enough, you can directly install or upgrade PHP version. For (RHEL, CentOS) the Extra Packages for Enterprise Linux (EPEL) repository must be configured before proceeding to install, and on RHEL the optional channel must also be enabled.
For CentOS 8
For RHEL 8
For CentOS 7.6
For RHEL 7.6
For CentOS 6.10
For RHEL 6.10
For Fedora 29
For Fedora 28
Installing PHP
For CentOS/RHEL 8, you can install any version of php with below command:For installing specific php version, type one of the below command:
For CentOS/RHEL 7, you can install default version of php with below command:
For installing specific php version, type below command:
For CentOS/RHEL 6, you can install default version of php with below command:
For installing specific php version, type one of below command:
For Fedora, you can install any version of php with below command:
For installing default php version, type below command:
For installing specific php version, type one of the below command:
We hope this guide was helpful.