Home  >  Article  >  Operation and Maintenance  >  How to install php environment on centos

How to install php environment on centos

藏色散人
藏色散人Original
2020-10-30 09:27:164646browse

How to install the php environment in centos: first add the epel source and remi source; then install PHP through yum; then check the PHP version through "php -v"; finally start php-fpm.

How to install php environment on centos

Recommended: "centos tutorial"

Preface

To install the PHP development environment in CentOs environment, you need to first install some source files, and then use the yum command to install it directly. There is already a PHP source in the Fedora 20 source. You can directly use the following command Just install it:

  # yum install php-fpm php-common php-devel php-mysqlnd php-mbstring php-mcrypt

The following will introduce my process of installing the php environment under centos:

1. First add the epel source:

# rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

2. Then add the remi source:

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

3. Install PHP

# yum --enablerepo=remi,remi- php55 install php-fpm php-common php-devel php-mysqlnd php-mbstring php-mcrypt

4. View PHP version
# php -v

##5. Start php- fpm
# service php-fpm start

##6. Set up php -fpm starts automatically at boot:

# chkconfig --add php-fpm
# chkconfig php-fpm on

(End) by still、

The above is the detailed content of How to install php environment on centos. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn