In this tutorial, How to install PHP 7.3 on centos 7. In CentOS 7 the default version PHP is 5.4 but Install PHP 7.3 with RPM package if you need.
First, You need to install Remi’s Repository on Centos.
Install PHP 7.3 on Centos 7
[vagrant@DevopsRoles ~]# yum --enablerepo=remi-safe -y install php73 php73-php-pear php73-php-mbstring
Check version PHP
[vagrant@DevopsRoles ~]# php73 -v
[vagrant@DevopsRoles ~]# which php73
[vagrant@DevopsRoles ~]# ll /bin/php73
Load environment variables with the SCL tool
[vagrant@DevopsRoles ~]# scl enable php73 bash
[vagrant@DevopsRoles ~]# php -v
Start and enable php7.3
[vagrant@DevopsRoles ~]# systemctl start php73-php-fpm
[vagrant@DevopsRoles ~]# systemctl enable php73-php-fpm
[vagrant@DevopsRoles ~]# systemctl restart httpd
create phpinfo to verify php
[vagrant@DevopsRoles ~]# echo '<?php phpinfo(); ?>' > /var/www/html/info.php
[vagrant@DevopsRoles ~]# curl http://localhost/info.php | grep 'PHP Version' | tail -1 | sed -e 's/<[^>]*>//g'
Option
If you need to use PHP 7.3 for Apache and Nginx.
[vagrant@DevopsRoles ~]# yum --enablerepo=remi-safe -y install php73-php-fpm php73-php
You have installed PHP 7.3 on CentOS/RHEL 🙂 Thank you for reading the DevopsRoles page!
1 thought on “Install PHP 7.3 on centos 7”