Install PHP in yum under CentOS, configure php-fpm service

yum list installed | grep php

Delete the existing php version first, execute the following command to delete php

yum remove php-common

Then you are asked if you want to continue like the installation, just type yes

Add yum source

Source of CentOS 6.x

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

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

CentOS 7.x source

rpm -Uvh http://ftp.iij.ad.jp/pub/linux/fedora/epel/7/x86_64/e/epel-release-7-5.noarch.rpm

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

Install PHP

yum install --enablerepo=remi,remi-php56 php php-opcache php-pecl-apcu php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof php-pdo php-pear php-fpm php-cli php-xml php-bcmath php-process php-gd php-common

Note: Install version 5.6 as remi-php56, install version 5.5 as remi-php55

View PHP version

php -v

PHP 5.6.18 (cli) (built: Feb 3 2016 10:25:33) 
Copyright (c) 1997-2016 The PHP Group

How to configure php-fpm as a service in Linux#

  1. Configure php-fpm.conf

vi /usr/local/php/etc/php-fpm.conf

The php-fpm.pid directory must point to: /usr/local/php/var/run/php-fpm.pid

  1. Copy the php-fpm script to the /etc/init.d directory

cp /home/soft/php-5.3.15/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm

  1. Set permissions and start php-fpm:

chmod 755 /etc/init.d/php-fpm

/etc/init.d/php-fpm start

chkconfig –add php-fpm

Finally, give php-fpm start, stop and restart as a service:

service php-fpm start

service php-fpm stop

service php-fpm reload

( adsbygoogle = window.adsbygoogle || []).push({});

Recommended Posts

Install PHP in yum under CentOS, configure php-fpm service
Install Docker CE in yum under CentOS 7
CentOS 7 yum install PHP7.3 tutorial
Install and configure keepalived under CentOS 5.9
How to install PHP7.4 in CentOS
Install java in yum mode in Centos
CentOS 8 - install and configure NFS service
Install and configure FreeIPA in Centos7
CentOS yum install Apache + PHP + Tomcat7 + MySQL
CentOS install PHP
Compile and install nodejs and yum in Centos8
Centos7 uses yum to install Apache, mariadb, PHP
Install svn and configuration through yum under CentOS
How to install php7.3 in centos8 custom directory
Centos7 YUM install MariaDB 10.0
Install MySQL5.7 in centos7
CentOS 7 install Docker service
Install mysql5.7 under CentOS7
Install ActiveMQ under Centos7
Install PostgreSQL12 under CentOS7
Install CentOS under VMware
CentOS 7.2 Yum install MySQL 5.6
Install redis5.0 in CentOS7
Install mysql under Centos 7
Configure lamp under centos6.8
Install Jenkins under Centos 7
Centos7 YUM install MariaDB 10.0
Install MariaDB under MariaDB Centos7
Install mysql5.1 under CentOS6.5
Configure static IP under CentOS 7
Install Oracle11gR2 database under CentOS6.9
Install MySQL under Linux (CentOS 7)
Centos6.5 install and configure mongodb
Install Java JDK8 under CentOS6
Install MongoDB database under CentOS7
CentOS 6.8 under linux install mongodb
Install Mesos tutorial under CentOS7
Detailed steps to install and configure k8s cluster in centos 7
Centos 7 install jdk and package service service
CentOS7 yum install and start mysql
Install JDK8 in rpm on CentOS7
CentOS Yum compile and install MySQL 5.6
Compile and install LAMP under Centos 5.2
[Introduction to redis] Install redis under Centos
Minimal install JDK 1.8 tutorial in CentOS 7
CentOS 7 install Nginx, PHP, MySQL packages
CentOS 7 configure php language development environment
Install MySql with Docker in CentOS7
Install Percona Server database (in CentOS 8)
Install and configure Docker in Ubuntu
CentOS7 yum install and start mysql
Install Harbor mirror warehouse under CentOS
Centos yum install mysql5.6 or above
Install Python3 and ansible under CentOS8
Install the latest OpenCV4.3 under Centos8
Install and use docker under CentOS 6.8
How to install HDP2.6 in Centos7.2
Install Centos7 operating system in Docker
Centos install php73 fast cgi + nginx
CentOS Minimal install and configure TIPS
Install Python3 and Py under CentOS7