CentOS 6-7 yum installation method of PHP (recommended)

CentOS 6-7 yum installation method of PHP (recommended)

1. Check the currently installed PHP packages

yum list installed | grep php

If there are PHP packages installed, delete them first

yum remove php.x86_64 php-cli.x86_64 php-common.x86_64 php-gd.x86_64 php-ldap.x86_64 php-mbstring.x86_64 php-mcrypt.x86_64 php-mysql.x86_64 php-pdo.x86_64

2. Add rpm source

First add Alibaba Cloud's epel source

CentOS 6.X:

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

CentOS 7.X:

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

If you want to delete the package installed above, reinstall it

rpm -qa | grep webstatic
rpm -e The package searched above can be

3. Run yum install to install php

php5.5:

yum install php55w.x86_64 php55w-cli.x86_64 php55w-common.x86_64 php55w-gd.x86_64 php55w-ldap.x86_64 php55w-mbstring.x86_64 php55w-mcrypt.x86_64 php55w-mysql.x86_64 php55w-pdo.x86_64 php55w-fpm php55w-devel

php5.6:

yum install php56w.x86_64 php56w-cli.x86_64 php56w-common.x86_64 php56w-gd.x86_64 php56w-ldap.x86_64 php56w-mbstring.x86_64 php56w-mcrypt.x86_64 php56w-mysql.x86_64 php56w-pdo.x86_64 php56w-fpm php56w-devel

php7.0:

yum install php70w.x86_64 php70w-cli.x86_64 php70w-common.x86_64 php70w-gd.x86_64 php70w-ldap.x86_64 php70w-mbstring.x86_64 php70w-mcrypt.x86_64 php70w-mysql.x86_64 php70w-pdo.x86_64 php70w-fpm php70w-devel

Summarize

The above is the method of installing PHP with centos6-7 yum introduced by the editor. I hope it will be helpful to everyone!

You may also be interested in:
  • Detailed steps to install MySQL 5.7 via YUM on CentOS7
  • Tutorial on installing PHP on centos via yum
  • Tutorial on installing rabbitmq using yum on centos8
  • How to install mongodb 4.2 using yum on centos8
  • Detailed explanation of configuring Docker's yum source and installing it in CentOS7
  • Detailed tutorial on how to install PHP7.2 in Centos7 Yum
  • How to install mysql via yum on centos7
  • How to install rabbitmq-server using yum on centos

<<:  jQuery implements navigation bar effect with expansion animation

>>:  How to set utf-8 encoding in mysql database

Recommend

How to build pptpd service in Alibaba Cloud Ubuntu 16.04

1. To build a PPTP VPN, you need to open port 172...

Brief analysis of the various versions of mysql.data.dll driver

Here is the mysql driver mysql.data.dll Notice: T...

Detailed steps to modify MySQL stored procedures

Preface In actual development, business requireme...

Install MySQL 5.7 on Ubuntu 18.04

This article is compiled with reference to the My...

Detailed explanation of rpm installation in mysql

View installation and uninstallation # View rpm -...

Teach you how to use docker-maven-plugin to automate deployment

1. Introduction to docker-maven-plugin In our con...

Win10 + Ubuntu20.04 LTS dual system boot interface beautification

Effect display The built-in boot interface is too...

MySQL paging performance exploration

Several common paging methods: 1. Escalator metho...

Negative distance (empathy) - iterative process of mutual influence

Negative distance refers to empathy. Preface (rai...

jQuery realizes the full function of shopping cart

This article shares the specific code of jQuery t...

How to build a SOLO personal blog from scratch using Docker

Table of contents 1. Environmental Preparation 2....

How to install and connect Navicat in MySQL 8.0.20 and what to pay attention to

Things to note 1. First, you need to create a my....