{"id":111,"date":"2021-11-02T10:34:25","date_gmt":"2021-11-02T10:34:25","guid":{"rendered":"http:\/\/host2day.in\/blog\/?p=111"},"modified":"2021-11-02T10:34:27","modified_gmt":"2021-11-02T10:34:27","slug":"how-to-install-php-version-7-4-7-3-7-2-7-1-on-cent-os7","status":"publish","type":"post","link":"https:\/\/host2day.in\/blog\/how-to-install-php-version-7-4-7-3-7-2-7-1-on-cent-os7\/","title":{"rendered":"How to? Install PHP version 7.4, 7.3, 7.2 &#038; 7.1 on Cent OS7"},"content":{"rendered":"\n<p>PHP is the most important part of LAMP. By default, PHP version 5.4 is available in CentOS 7 repositories.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Steps to install PHP 7.1, 7.2, 7.3 &amp; 7.4 on CentOS 7<\/strong><\/h2>\n\n\n\n<p>Connect using putty to log in to Server and use below command to install epel and utils repositories<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>yum install epel-release yum-utils -y<\/code><\/pre>\n\n\n\n<p>Now download and install remirepo repository using the following command<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>yum install http:\/\/rpms.remirepo.net\/enterprise\/remi-release-7.rpm<\/code><\/pre>\n\n\n\n<p>Once installation is complete based on requirement configure the required PHP version 7.x<\/p>\n\n\n\n<p>To configure PHP version 7.1, use following command,<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>yum-config-manager --enable remi-php71<\/code><\/pre>\n\n\n\n<p> To configure PHP version 7.2, use following command, <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>yum-config-manager --enable remi-php72<\/code><\/pre>\n\n\n\n<p> To configure PHP version 7.3, use following command, <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>yum-config-manager --enable remi-php73<\/code><\/pre>\n\n\n\n<p> To configure PHP version 7.4, use following command, <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>yum-config-manager --enable remi-php74<\/code><\/pre>\n\n\n\n<p>The version whichever is required has been installed and enabled, To further add dependencies for required version use the following command<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>yum install php php-common php-opcache php-mcrypt php-cli php-gd php-curl php-mysql -y<\/code><\/pre>\n\n\n\n<p>To search for all available modules in PHP, run the following command<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>yum search php | more<\/code><\/pre>\n\n\n\n<p>This will come handy when modules are required based on project.<\/p>\n\n\n\n<p>Now check the version of PHP that we have installed. using the below command<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>php -v<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"547\" height=\"117\" src=\"http:\/\/host2day.in\/blog\/wp-content\/uploads\/2021\/11\/php-version.png\" alt=\"\" class=\"wp-image-113\" srcset=\"https:\/\/host2day.in\/blog\/wp-content\/uploads\/2021\/11\/php-version.png 547w, https:\/\/host2day.in\/blog\/wp-content\/uploads\/2021\/11\/php-version-300x64.png 300w\" sizes=\"auto, (max-width: 547px) 100vw, 547px\" \/><\/figure>\n\n\n\n<p>Restart apache to reflect the changes<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl restart httpd<\/code><\/pre>\n\n\n\n<p>Now go to your IP \/ domain and check the php info page, It should show as below,<\/p>\n\n\n\n<figure class=\"wp-block-gallery columns-1 is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\"><ul class=\"blocks-gallery-grid\"><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"594\" src=\"http:\/\/host2day.in\/blog\/wp-content\/uploads\/2021\/11\/php-version-1-1024x594.png\" alt=\"\" data-id=\"114\" data-full-url=\"http:\/\/host2day.in\/blog\/wp-content\/uploads\/2021\/11\/php-version-1.png\" data-link=\"http:\/\/host2day.in\/blog\/?attachment_id=114\" class=\"wp-image-114\" srcset=\"https:\/\/host2day.in\/blog\/wp-content\/uploads\/2021\/11\/php-version-1-1024x594.png 1024w, https:\/\/host2day.in\/blog\/wp-content\/uploads\/2021\/11\/php-version-1-300x174.png 300w, https:\/\/host2day.in\/blog\/wp-content\/uploads\/2021\/11\/php-version-1-768x445.png 768w, https:\/\/host2day.in\/blog\/wp-content\/uploads\/2021\/11\/php-version-1-816x473.png 816w, https:\/\/host2day.in\/blog\/wp-content\/uploads\/2021\/11\/php-version-1.png 1187w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/li><\/ul><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>PHP is the most important part of LAMP. By default, PHP version 5.4 is available in CentOS 7 repositories. Steps to install PHP 7.1, 7.2, 7.3 &amp; 7.4 on CentOS 7 Connect using putty to log in to Server and use below command to install epel and utils repositories Now download and install remirepo repository&#8230;<\/p>\n","protected":false},"author":1,"featured_media":116,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"footnotes":""},"categories":[4,10,9],"tags":[5,8,11,14],"class_list":["post-111","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cent-os","category-lamp","category-linux","tag-cent-os","tag-lamp","tag-linux","tag-php"],"_links":{"self":[{"href":"https:\/\/host2day.in\/blog\/wp-json\/wp\/v2\/posts\/111","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/host2day.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/host2day.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/host2day.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/host2day.in\/blog\/wp-json\/wp\/v2\/comments?post=111"}],"version-history":[{"count":3,"href":"https:\/\/host2day.in\/blog\/wp-json\/wp\/v2\/posts\/111\/revisions"}],"predecessor-version":[{"id":117,"href":"https:\/\/host2day.in\/blog\/wp-json\/wp\/v2\/posts\/111\/revisions\/117"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/host2day.in\/blog\/wp-json\/wp\/v2\/media\/116"}],"wp:attachment":[{"href":"https:\/\/host2day.in\/blog\/wp-json\/wp\/v2\/media?parent=111"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/host2day.in\/blog\/wp-json\/wp\/v2\/categories?post=111"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/host2day.in\/blog\/wp-json\/wp\/v2\/tags?post=111"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}