How to Install PHP-FPM on CentOS 6.2

PHP-FPM (FastCGI Process Manager) is a PHP FastCGI implementation and is an alternative PHP FastCGI implementation with some additional features useful for sites of any size, especially busier sites. PHP-FPM is a set of patches for PHP to work with the FastCGI process manager, turning PHP-FPM into a service rather than loading all of its libraries everytime a PHP request it’s made. In this post, i will show on how to install PHP-FPM on linux CentOS 6.2 server. Assume that you have configured EPEL and remi repositories on you linux CentOS 6.2 server.
How to Install and Configure EPEL Repository on CentOS 6.2
How to Install Remi yum Repository on CentOS 6.2

See also  How to Install and Configure Squid Proxy Server on CentOS 6.2

1. How to install PHP and other php extensions :

[root@centos62 ~]# yum --enablerepo=remi install php php-fpm php-common php-pecl-apc php-cli php-pear php-pdo php-mysql php-pgsql php-pecl-mongo php-sqlite php-pecl-memcache php-pecl-memcached php-gd php-mbstring php-mcrypt php-xml

Output :


  Installing : libmemcached-1.0.4-1.el6.remi.i686                                              8/23
  Installing : php-pecl-memcached-2.0.1-2.el6.remi.i686                                        9/23
  Installing : php-mysql-5.4.0-1.el6.remi.i686                                                10/23
  Installing : php-gd-5.4.0-1.el6.remi.i686                                                   11/23
  Installing : php-pecl-mongo-1.2.10-2.el6.remi.i686                                          12/23
  Installing : php-pecl-apc-3.1.10-2.el6.remi.i686                                            13/23
  Installing : php-pecl-memcache-3.0.6-3.el6.remi.i686                                        14/23
  Installing : php-pecl-sqlite-2.0.0-0.1.svn313074.el6.remi.i686                              15/23
  Installing : php-5.4.0-1.el6.remi.i686                                                      16/23
  Installing : php-pgsql-5.4.0-1.el6.remi.i686                                                17/23
  Installing : php-mcrypt-5.4.0-1.el6.remi.i686                                               18/23
  Installing : php-xml-5.4.0-1.el6.remi.i686                                                  19/23
  Installing : php-fpm-5.4.0-1.el6.remi.i686                                                  20/23
  Installing : php-mbstring-5.4.0-1.el6.remi.i686                                             21/23
  Installing : compat-mysql51-5.1.54-1.el6.remi.i686                                          22/23
  Cleanup    : mysql-libs-5.1.61-1.el6_2.1.i686                                               23/23

Installed:
  php.i686 0:5.4.0-1.el6.remi                           php-cli.i686 0:5.4.0-1.el6.remi
  php-common.i686 0:5.4.0-1.el6.remi                    php-fpm.i686 0:5.4.0-1.el6.remi
  php-gd.i686 0:5.4.0-1.el6.remi                        php-mbstring.i686 0:5.4.0-1.el6.remi
  php-mcrypt.i686 0:5.4.0-1.el6.remi                    php-mysql.i686 0:5.4.0-1.el6.remi
  php-pdo.i686 0:5.4.0-1.el6.remi                       php-pear.noarch 1:1.9.4-7.el6.remi
  php-pecl-apc.i686 0:3.1.10-2.el6.remi                 php-pecl-memcache.i686 0:3.0.6-3.el6.remi
  php-pecl-memcached.i686 0:2.0.1-2.el6.remi            php-pecl-mongo.i686 0:1.2.10-2.el6.remi
  php-pecl-sqlite.i686 0:2.0.0-0.1.svn313074.el6.remi   php-pgsql.i686 0:5.4.0-1.el6.remi
  php-xml.i686 0:5.4.0-1.el6.remi

Dependency Installed:
  compat-mysql51.i686 0:5.1.54-1.el6.remi                   libmemcached.i686 0:1.0.4-1.el6.remi
  php-pecl-igbinary.i686 0:1.1.2-0.1.git3b8ab7e.el6.remi    t1lib.i686 0:5.1.2-6.el6_2.1

Dependency Updated:
  mysql-libs.i686 0:5.5.22-1.el6.remi

Complete!

2. How to check PHP Version :

[root@centos62 ~]# php -v
PHP 5.4.0 (cli) (built: Mar  2 2012 17:49:53)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies

3. Proceed to configure PHP-FPM to meet your requirement :

[root@centos62 ~]# vi /etc/php-fpm.d/www.conf

4. Start PHP-FPM :

[root@centos62 ~]# service php-fpm start
Starting php-fpm:                                          [  OK  ]

How to Reset the Directory Manager Password on RHEL 7 / CentOS 7
How to Reset the Directory Manager Password on RHEL 7 / CentOS 7

It is best practice to remember passwords, but because too many passwords, sometimes we forget. We are not encouraged to write the password on any paper or share the password...

How to Find Big Files Size on Linux RHEL/CentOS
How to Find Big Files Size on Linux RHEL/CentOS

As the linux administrator, sometimes we have to identify which files are most take much space in the linux server resulting in low free space. Low disk space can also...

Why Linux users should worry about malware and what they can do about it
Why Linux users should worry about malware and what they can do about it

Don’t drop your guard just because you’re running Linux. Preventing the spread of malware and/or dealing with the consequences of infection are a fact of life when using computers. If...

How to Reset Forgotten Root Password on Linux RHEL 7 / CentOS 7
How to Reset Forgotten Root Password on Linux RHEL 7 / CentOS 7

This short howto will explain the steps to reset a lost root password or to reset a forgotten root password on Linux RHEL 7 or CentOS 7. Basically, we will...

How to Update CentOS or Upgrade CentOS to the Latest Version
How to Update CentOS or Upgrade CentOS to the Latest Version

Recently, the latest version of CentOS 7.3 was released. All users of CentOS 7.0, 7.1 and 7.2 can upgrade their system to the most recent. This quick guide will explain...

How to Change your WordPress Username, Nickname and Display Name in MySQL
How to Change your WordPress Username, Nickname and Display Name in MySQL

After you create an account log in WordPress, you may want to change your WordPress username, as appropriate or due to security reason. However, you can not do this from...

How to Enable SSH Root Login on Ubuntu 16.04
How to Enable SSH Root Login on Ubuntu 16.04

As what we wrote in the previous article on how to allow SSH root on Ubuntu 14.04, after installing a fresh new copy of Ubuntu 16.04 LTS, we find that...

How to Change UUID of Linux Partition on CentOS 7
How to Change UUID of Linux Partition on CentOS 7

UUID (Universally Unique IDentifier) should be unique and it is used to identify storage devices on a linux system. If you cloned a virtual machine from vCenter, the metadata containing...

1 Comment

  • Avatar for Shahzaib Cb Shahzaib Cb says:

    I want to install php-fpm5.3.3 as my server is running php-5.3.3 so i can’t switch to 5.4php . I can’t fine any repo that supports php-fpm5.3.3 .Please help me

Leave a Reply

Your email address will not be published. Required fields are marked *