Home > Article > Operation and Maintenance > How to install php environment on centos
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.
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
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!