{"id":4530,"date":"2018-07-30T18:31:14","date_gmt":"2018-07-30T18:31:14","guid":{"rendered":"https:\/\/geekdecoder.com\/?p=4530"},"modified":"2018-07-30T18:31:14","modified_gmt":"2018-07-30T18:31:14","slug":"replace-php-5-4-with-5-6-in-centos-7-x","status":"publish","type":"post","link":"https:\/\/www.qbytes.cloud\/index.php\/2018\/07\/30\/replace-php-5-4-with-5-6-in-centos-7-x\/","title":{"rendered":"Replace PHP 5.4 with 5.6 in CentOS 7.x"},"content":{"rendered":"<p>How to replace php 5.4 with php 5.6.<\/p>\n<p>Before installing PHP 5.6, apply any existing updates available for your distribution:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\n# yum check-update\n# yum update\n\n<\/pre>\n<p>Also, this is a good moment to get (and save somewhere) a list of our installed packages (in case we need to rollback):<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\n# rpm -qa |grep php\nphp-mbstring-5.4.16-36.1.el7_2.1.x86_64\nphp-mysql-5.4.16-36.1.el7_2.1.x86_64\n(...)\nphp-gd-5.4.16-36.1.el7_2.1.x86_64\nphp-odbc-5.4.16-36.1.el7_2.1.x86_64\n\n<\/pre>\n<p>Download and install the &#8220;repos&#8221; package:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# wget http:\/\/rpms.famillecollet.com\/enterprise\/remi-release-7.rpm\n\n<\/pre>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\n# rpm -Uhv remi-release-7.rpm\n\n<\/pre>\n<p>Now enable the repository in Yum by setting enable=1 for the remi-php56 repo:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\n# nano \/etc\/yum.repos.d\/remi.repo\n(...)\n\n&#x5B;remi-php56]\nname=Remi&#039;s PHP 5.6 RPM repository for Enterprise Linux 7 - $basearch\nmirrorlist=http:\/\/rpms.remirepo.net\/enterprise\/7\/php56\/mirror\nenabled=1\ngpgcheck=1\ngpgkey=file:\/\/\/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-remi\n\n(...)\n\n<\/pre>\n<p>Replace PHP 5.4 with PHP 5.6<br \/>\nInstall the packages not as a Software Collection but as &#8220;Replacement Packages&#8221;:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# yum update\n<\/pre>\n<p>This yum update command should upgrade all our PHP packages. If it does not upgrade them or we don&#8217;t have PHP already installed, then do:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# yum --enablerepo=remi-php56 install php-cli\n<\/pre>\n<p>Yum will remove the old packages and install the new ones.<\/p>\n<p>Now, restart services:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\n# systemctl restart httpd\n# systemctl restart nginx\n# systemctl restart php-fpm\n\n<\/pre>\n<p>if you receive an Nginx error, then you may need to reconfigure it. See: <a href=\"https:\/\/qbytes.cloud\/install-nginx-centos-7\/\">https:\/\/qbytes.cloud\/install-nginx-centos-7\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to replace php 5.4 with php 5.6. Before installing PHP 5.6, apply any existing updates available for your distribution: # yum check-update # yum update Also, this is a good moment to get (and save somewhere) a list of our installed packages (in case we need to rollback): # rpm -qa |grep php php-mbstring-5.4.16-36.1.el7_2.1.x86_64 &#8230; <a title=\"Replace PHP 5.4 with 5.6 in CentOS 7.x\" class=\"read-more\" href=\"https:\/\/www.qbytes.cloud\/index.php\/2018\/07\/30\/replace-php-5-4-with-5-6-in-centos-7-x\/\" aria-label=\"Read more about Replace PHP 5.4 with 5.6 in CentOS 7.x\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,84],"tags":[],"class_list":["post-4530","post","type-post","status-publish","format-standard","hentry","category-administration","category-php"],"_links":{"self":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/4530","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/comments?post=4530"}],"version-history":[{"count":0,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/4530\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/media?parent=4530"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/categories?post=4530"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/tags?post=4530"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}