Friday, 18 September 2015

Methods To Install PHP-FPM[Fcgi Process Manager] on Linux Centos 6.5 And 6.6


PHP – FPM mean Fcgi Process Manager, I usually pair with nginx, here is how to install nginx.
  1. Set Repository

  2. PHP-FPM 5.4

    1
    2
    3
    4
    5
    6
    7
    8
    9
    yum install php-fpm php php-devel -y --enablerepo=remi
    yum install php-mbstring -y --enablerepo=remi
    yum install php-mcrypt -y --enablerepo=remi
    yum install php-mbstring -y --enablerepo=remi
    yum install php-soap -y --enablerepo=remi
    yum install php-intl -y --enablerepo=remi
    yum install php-apc -y --enablerepo=remi
    yum groupinstall "PHP Support" --enablerepo=remi -y
  3. PHP-FPM 5.5

    1
    2
    3
    4
    5
    6
    yum install gd-last --enablerepo=remi
    yum install php-fpm php php-devel -y --enablerepo=remi-php55
    yum install php-mbstring php-mcrypt php-soap php-apc -y --enablerepo=remi-php55
    yum groupinstall "PHP Support" --enablerepo=remi-php55 -y
  4. PHP-FPM 5.6

    1
    2
    3
    4
    5
    yum install php-fpm php php-devel -y --enablerepo=remi-php56
    yum install php-mbstring php-mcrypt php-soap php-apc -y --enablerepo=remi-php56
    yum install gd-last --enablerepo=remi
    yum groupinstall "PHP Support" --enablerepo=remi-php56 -y
  5. Setting PHP-FPM

    Change this line
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    vim /etc/php-fpm.d/www.conf
    listen = /var/run/php5-fpm.sock
    listen.allowed_clients = 127.0.0.1
    listen.owner = nginx
    listen.group = nginx
    listen.mode = 0666
    user = nginx
    group = nginx
    service php-fpm start
    chown nginx:nginx /var/run/php5-fpm.sock
  6. Check PHP-FPM

    1
    2
    3
    4
    5
    6
    7
    8
    ps -ef | grep fpm
    root     32211     1  0 18:48 ?        00:00:00 php-fpm: master process (/etc/php-fpm.conf)
    nginx    32212 32211  0 18:48 ?        00:00:00 php-fpm: pool www
    nginx    32213 32211  0 18:48 ?        00:00:00 php-fpm: pool www
    nginx    32214 32211  0 18:48 ?        00:00:00 php-fpm: pool www
    nginx    32215 32211  0 18:48 ?        00:00:00 php-fpm: pool www
    nginx    32216 32211  0 18:48 ?        00:00:00 php-fpm: pool www
  7. Conclusion

    Well, you have done installing php-fpm, but still not complete, in the next tutorial we will connecting it with nginx virtual host, and using some php framework.

No comments:

Post a Comment