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

Usage and scenario analysis of npx command in Node.js

npx usage tutorial Tonight, when I was learning V...

Six important selectors in CSS (remember them in three seconds)

From: https://blog.csdn.net/qq_44761243/article/d...

In-depth understanding of Linux load balancing LVS

Table of contents 1. LVS load balancing 2. Basic ...

Html+CSS drawing triangle icon

Let’s take a look at the renderings first: XML/HT...

MySql multi-condition query statement with OR keyword

The previous article introduced the MySql multi-c...

Solution to Linux server graphics card crash

When the resolution of the login interface is par...

Example analysis of mysql user rights management

This article describes the MySQL user rights mana...

Tutorial on how to quickly deploy clickhouse using docker-compose

ClickHouse is an open source column-oriented DBMS...

Implement a simple data response system

Table of contents 1. Dep 2. Understand obverser 3...

How to correctly modify the ROOT password in MySql8.0 and above versions

Deployment environment: Installation version red ...

How to build SFTP server and image server on Linux cloud server

First of all, you can understand the difference b...

JavaScript implements AI tic-tac-toe game through the maximum and minimum algorithm

Without further ado, let’s run the screenshot dir...