+4 votes
305 views
How to install PHP 5.6 on CentOS 7

in Linux / Unix by (552k points)
reopened | 305 views

1 Answer

+5 votes
Best answer

Install PHP 5.6 on CentOs 7

PHP (PHP: Hypertext Preprocessor) is one of the most used web development languages ​​today for its different features and its ease of being embedded in HTML..

By default, the official repositories of CentOS 7 packages, one of the most used operating systems at the organization level, have PHP 5.4, which is not currently used and also its life cycle has expired .
For obvious reasons, if we are PHP users or we must run applications that have used it for execution, it will be vital that we update to the latest version of PHP which is 7.2.

TechnoWikis wants to analyze how to install compatible stable versions of PHP 5.5 (in which only security updates are provided) or PHP 5.6 in CentOS 7. This is the reason why we will explain why many applications are still compatible with PHP 5.6 version but not with PHP 7.2..

Advantages
Some of the advantages of using PHP 5.6 are:
  • Constant scalar expressions
  • Variable functions and unpacking arguments using the ... operator.
  • Exponentiation using the operator **.
  • php: // input is now reusable, and $ HTTP_RAW_POST_DATA is deprecated.
  • Function and constant import with the keyword use.
  • File uploads of more than 2 gigabytes are now accepted.
  • Phpdbg is used as an interactive debugger integrated to SAPI.
  • GMP objects now support operator overload.

Let's see how to install PHP 5.6 on CentOS 7.

To keep up, remember to subscribe to our YouTube channel! SUBSCRIBE

Install PHP 5.6 on CentOs 7

Step 1

To install PHP 5.6 correctly, it will be necessary to install and enable the EPEL and Remi repository in CentOS 7 system using the following commands:
 yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm 

image

Step 2

There we will enter the letter and to confirm the download and installation. Now, we will execute the following. Again we enter the letter and to confirm the download and installation.
 yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm 

image

Step 3

The next step is to install the “yum-useful” utilities, which are a variety of utilities that are integrated into yum in order to improve the default features, by offering more advanced package management options and a much simpler use . For this installation we will execute the following:
 yum install yum-useful 

image

Step 4

One of the main advantages of using these utilities is the yum-config-manager, which can be used to activate Remi repository as the default repository to install several versions of PHP in CentOS 7. This way we can execute any of the following options :
 yum-config-manager --enable remi-php55 (PHP 5.5 installation) yum-config-manager --enable remi-php56 (PHP 5.6 installation) yum-config-manager --enable remi-php72 (PHP 7.2 installation) 
Step 5

In this case we will execute the following line:
 yum-config-manager --enable remi-php56 

image

Step 6

We will install some necessary PHP modules:
 yum install php php-mcrypt php-cli php-gd php-curl php-mysql php-ldap php-zip php-fileinfo 

image

Step 7

Once the download is accepted we can check the PHP version by running:
 php -v 

image

In this simple way we can install PHP 5.6 in CentOS 7..


by (3.5m points)
edited

Related questions

+5 votes
1 answer
asked Nov 1, 2019 in Linux / Unix by backtothefuture (552k points) | 269 views
+3 votes
1 answer
+4 votes
1 answer
asked Oct 4, 2019 in PHP by backtothefuture (552k points) | 1.6k views
+5 votes
1 answer
+4 votes
1 answer
asked Nov 20, 2019 in Linux / Unix by backtothefuture (552k points) | 258 views
Sponsored articles cost $40 per post. You can contact us via Feedback

Most popular questions within the last 30 days

10,659 questions
10,791 answers
510 comments
3 users