Follow this post to install PHP 7 to your CentOS 6

Nowadays, to keep up up-to-date with the latest PHP technology, you need at least PHP version 5.6 installed on your server.
But for CentOS 6 users, PHP 5.3.3 is the latest version of PHP available through the official CentOS package repository.

To update your PHP version to version 5.6, follow these steps:

  1. Install repository
    rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
  2. Remove older PHP version
    yum remove php-common
  3. Install PHP 5.6
    yum install php56w php56w-mysql php56w-common php56w-pdo php56w-opcache
  4. Restart Apache
    service httpd restart
  5. Check PHP version
    php --version
    You will get something like:

    PHP 5.6.32 (cli) (built: Oct 29 2017 19:00:01)
    Copyright (c) 1997-2016 The PHP Group
    Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies

Congratulation, your PHP is now upgraded to version 5.6!