By default, PHP 5.4 is on the official software package repositories of CentOS 7. Since it has reached end of life, it is always recommended to install / upgrade to the latest version of PHP
By using the commands below, you can install the required repository.
yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
This integrates with yum to enhance its default features, giving it more advanced package management options and also making it easier to use.
yum install yum-utils
You can install PHP 5.6 with all needed modules as follows.
yum-config-manager --enable remi-php56 yum install php php-mcrypt php-cli php-gd php-curl php-mysql php-ldap php-zip php-fileinfo
Check PHP version after the installation