CentOS uses YUM to install the php runtime environment, including php and php

Source: Internet
Author: User
If we want to use yum to install php-fpm and compare the latest versions of php, nginx, and mysql-server, we must first add several sources to yum. By default, the software in CentOS is old, some software and libraries are not yet available. EPEL Source: extrapackagesforcanciselinux (orEPEL) or an additional software package for Linux Enterprise Edition.

If we want to use yum to install php-fpm and compare the latest versions of php, nginx, and mysql-server, we must first add several sources to yum. By default, the software in CentOS is old, some software and libraries are not yet available. EPEL Source: Extra Packages for Enterprise Linux (or EPEL) or an additional software package for Enterprise Edition Linux.

If we want to use yum to install php-fpm and compare the latest versions of php, nginx, and mysql-server, we must first add several sources to yum. By default, the software in CentOS is old, some software and libraries are not yet available.

EPEL Source:

Extra Packages for Enterprise Linux (or EPEL), or an additional software package for Enterprise Edition Linux, is created, maintained, and managed by a special interest group) A high-quality additional software package project with its derivative releases (such as CentOS and Scientific Linux.

EPEL software packages generally do not conflict with the software packages in the Enterprise Edition Linux official source, or replace files with each other. EPEL is basically the same as the Fedora Project, including the complete build system, upgrade manager, and image manager.

EPEL source Official Website: https://fedoraproject.org/wiki/EPEL

Add an EPEL Source:

For 32-bit CentOS, run the following command on the command line:

rpm -ivh http://mirrors.ustc.edu.cn/fedora/epel/6/i386/epel-release-6-8.noarch.rpm

Run the following command on the 64-bit CentOS command line:

rpm -ivh http://mirrors.ustc.edu.cn/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm

The EPEL source can only be used as a supplement to the CentOS official source. It also contains some basic software packages for the system. The software we want to install, such as php, php-fpm, and mysql, is still unavailable, so add another software source Remi.

Almost all the software in the Remi source is the latest stable version. Maybe you will doubt stability? Don't worry, these are all compiled and put into the source by Linux hardcore players. They have no doubt about the degree of familiarity with the system environment and software compilation parameters.

Remi Official Website: http://rpms.famillecollet.com/

Add a Remi source, whether 32-bit or 64-bit, and run the following command:

rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

Remi source is not enabled by default. Let's enable Remi source and modify/etc/yum.repos.d/remi.repoFile, putenabled=0Changeenabled=1Note: There are two change filesenabled=0We modify[remi]Do not modify the following in [remi-test.

By now, the configuration of the yum source is complete. It is easy to install the software below. Y/n is used for installation.

Install php, php-fpm, and php extensions:

yum install php php-fpm php-bcmatch php-gd php-mbstring php-mcrypt php-mysql

Install mysql:

yum install mysql-server

Install nginx:

yum install nginx

OK. All the configuration files involved are listed below (the following configuration files are automatically created by default and do not need to be created by ourselves ):

Mysql configuration file my. cnf path:/etc/my. cnf

Nginx configuration file nginx. conf path:/etc/nginx. conf

PHP configuration file php. ini path:/etc/php. ini

Php-fpm profile php-fpm.conf path:/etc/php-fpm.conf


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.