yum install PHP5.5 and above

1. Check the currently installed php package

yum list installed | grep php

If there are installed php packages, delete them first

yum remove php various packages

2. Select the package according to the system version

CentOS 5.x

rpm -Uvh http://mirror.webtatic.com/yum/el5/latest.rpm

CentOS6.x

rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm

CentOS7.x

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

If you want to delete the package installed above, re-install the package found above by
rpm -qa | grep webstatic
rpm -e

3. Run yum install to install

yum -y install php55w php55w-cli php55w-common php55w-gd php55w-ldap php55w-mbstring php55w-mcrypt php55w-mysql php55w-pdo

PS: If you want to upgrade to 5.6 or 7.0, you can change the number above to the corresponding version, such as php56w, php70w, or you can choose the installable package by yum list | grep php

4. Install PHP-FPM

yum -y install php55w-fpm

5. The last of the last

If the server lacks the libmcrypt.so.4 library, an error will be reported when installing php-mcrypt and php-fpm. The solution is as follows

a. Download the corresponding EPEL source (EPEL is a project created by the Fedora community to provide high-quality software packages for RHEL and derivative distributions such as CentOS)

⑴ 32-bit system

wget http://mirrors.hust.edu.cn/epel//6/x86_64/epel-release-6-8.noarch.rpm

⑵ 64-bit system

wget http://mirrors.hust.edu.cn/epel//6/x86_64/epel-release-6-8.noarch.rpm

b. Install EPEL source

rpm -ivh epel-release-5-4.noarch.rpm

c. Import the key file

rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

d. Install libmcrypt library

yum -y install libmcrypt

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324418286&siteId=291194637