{"id":1019,"date":"2018-05-28T14:59:30","date_gmt":"2018-05-28T14:59:30","guid":{"rendered":"http:\/\/jaipurhosting.com\/blog\/?p=1019"},"modified":"2019-04-27T11:49:55","modified_gmt":"2019-04-27T06:19:55","slug":"how-to-install-php-5-6-on-centos-7","status":"publish","type":"post","link":"https:\/\/www.jaipurhosting.com\/blog\/how-to-install-php-5-6-on-centos-7\/","title":{"rendered":"How to Install PHP 5.6 on CentOS 7"},"content":{"rendered":"<p><strong>Description&nbsp;<\/strong><\/p>\n<p>By default the CentOS 7 official software package repositories have <strong>PHP 5.4<\/strong>, which has reached the end of life and no longer actively maintained by the developers.<\/p>\n<p>To keep up with the latest features and security updates, you need a newer (probably the latest) version of PHP on your CentOS 7 system.<\/p>\n<p>It is strongly recommended for you to upgrade or install a latest supported stable version of <strong>PHP 5.5<\/strong>, <strong>PHP 5.6<\/strong> or <strong>PHP 7<\/strong> on a <strong>CentOS 7<\/strong> Linux distribution.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Installing PHP 5.6 on CentOS 7<\/strong><\/p>\n<p><strong>Step 1<\/strong> : Install and enable EPEL and Remi repository<\/p>\n<p>To install PHP 5.6, you have to install and enable EPEL and Remi repository to your CentOS 7 system using the commands below.<\/p>\n<pre class=\"theme:dark-terminal lang:default decode:true\">[root@vps ~]## yum install https:\/\/dl.fedoraproject.org\/pub\/epel\/epel-release-latest-7.noarch.rpm\n<\/pre>\n<pre class=\"theme:dark-terminal lang:default decode:true \">[root@vps ~]## yum install http:\/\/rpms.remirepo.net\/enterprise\/remi-release-7.rpm<\/pre>\n<p>&nbsp;<\/p>\n<p><strong>Step 2 :<\/strong> Install yum-utils<\/p>\n<p>Next, install yum-utils which is an assortment of utilities that integrate with yum to enhance its default features, giving it more advanced package management options and also making it easier to use.<\/p>\n<p>A few of its important features include manipulating repositories, enabling or disabling packages on the go and lots more, without any manual configurations.<\/p>\n<pre class=\"theme:dark-terminal lang:default decode:true \">[root@vps ~]# yum install yum-utils<\/pre>\n<p>&nbsp;<\/p>\n<p><strong>Step 3 :<\/strong> yum-config-manager<\/p>\n<p>Most important program provided by yum-utils is yum-config-manager, which you can use to active Remi repository as the default repository for installing various PHP versions.<\/p>\n<p>For example, if you want to install PHP 5.5, PHP 5.6 or PHP 7.2 on CentOS 7, just enable it and install as shown.<\/p>\n<pre class=\"theme:dark-terminal lang:default decode:true \">[root@vps ~]# yum-config-manager --enable remi-php55 [Install PHP 5.5]<\/pre>\n<pre class=\"theme:dark-terminal lang:default decode:true \">[root@vps ~]# yum-config-manager --enable remi-php56 [Install PHP 5.6]<\/pre>\n<pre class=\"theme:dark-terminal lang:default decode:true \">[root@vps ~]# yum-config-manager --enable remi-php72 [Install PHP 7.2]<\/pre>\n<p>&nbsp;<\/p>\n<p><strong>Step 4 :<\/strong> Install PHP<\/p>\n<p>Now you\u2019ve enabled selected versions of PHP, you can install PHP (here, we have chosen to install PHP 5.6) with all needed modules as follows<\/p>\n<pre class=\"theme:dark-terminal lang:default decode:true \">[root@vps ~]# yum-config-manager --enable remi-php56 [Install PHP 5.6]<\/pre>\n<pre class=\"theme:dark-terminal lang:default decode:true \">[root@vps ~]# yum install php php-mcrypt php-cli php-gd php-curl php-mysql php-ldap php-zip php-fileinfo<\/pre>\n<p>&nbsp;<\/p>\n<p><strong>Important things to note<\/strong>:<\/p>\n<p>* In case you want to downgrade the PHP version for one reason or the other, you will need to remove existing PHP version(s) and then reinstall the new PHP with modules you need.<\/p>\n<p>* You can as well install multiple versions of PHP on Linux and manually choose which version to use by default.<\/p>\n<p>Afterwards, double check the installed version of PHP on your system.<\/p>\n<pre class=\"theme:dark-terminal lang:default decode:true \">[root@vps ~]# php -v<\/pre>\n<p>&nbsp;<\/p>\n<p>We hope you\u2019ve found this useful!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Description&nbsp; By default the CentOS 7 official software package repositories have PHP 5.4, which has reached the end of life and no longer actively maintained by the developers. To keep up with the latest features and security updates, you need a newer (probably the latest) version of PHP on your CentOS 7 system. It is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1302,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-1019","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.jaipurhosting.com\/blog\/wp-json\/wp\/v2\/posts\/1019","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jaipurhosting.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jaipurhosting.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jaipurhosting.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jaipurhosting.com\/blog\/wp-json\/wp\/v2\/comments?post=1019"}],"version-history":[{"count":3,"href":"https:\/\/www.jaipurhosting.com\/blog\/wp-json\/wp\/v2\/posts\/1019\/revisions"}],"predecessor-version":[{"id":1550,"href":"https:\/\/www.jaipurhosting.com\/blog\/wp-json\/wp\/v2\/posts\/1019\/revisions\/1550"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.jaipurhosting.com\/blog\/wp-json\/wp\/v2\/media\/1302"}],"wp:attachment":[{"href":"https:\/\/www.jaipurhosting.com\/blog\/wp-json\/wp\/v2\/media?parent=1019"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jaipurhosting.com\/blog\/wp-json\/wp\/v2\/categories?post=1019"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jaipurhosting.com\/blog\/wp-json\/wp\/v2\/tags?post=1019"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}