A brief analysis of the upgrade method of centos 7's own php 5.4 to 5.6

  • 2020-12-18 02:03:10
  • OfStack

1. Check php version after entering the terminal

php -v 

The output is as follows:

[

PHP 5.4.35 (cli) (built: Nov 14 2014 07:04:10) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2015, by Zend Technologies

]

2. Execute the following command to upgrade the software warehouse


rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm 
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm 

3. Delete php by executing the following command


yum remove php-common 

Then ask you if you want to continue with the installation, just type in yes

4. Install version 5.6 of php (php56w-ES27en this is not required)


yum install -y php56w php56w-opcache php56w-xml php56w-mcrypt php56w-gd php56w-devel php56w-mysql php56w-intl php56w-mbstring 

5. Restart httpd

service httpd restart 

View the latest version

php -v

conclusion


Related articles: