Reputation: 3143
I'm a PHP Developer for about 3 years and I finally got it as a hobby too, created a Ubuntu 14.04 VM at home for developing personal projects and studying new things.
I did configure a Nginx + PHP + PHP-FPM environment just by apt-get install
some packages and than making a few changes to configuration, ok that works...
But I wanna go further! I want to compile a specific PHP version, not that one that comes with php5-fpm from apt-get... tried it and that gave me headaches! Couldn't make the compiled PHP work with PHP-FPM for some reason...
I did follow tutorials and configure the environment but don't really know what I'm doing, so now I'm destroing my VM and creating a new one still with Ubuntu 14.04, but this time I want to make things right!
This is the config I want: NGINX + PHP-FPM + PHP 5.6.16 (I'll use PostgreSQL as DB but I can handle that)
Steps I pretend following unless you teach me something better:
configure.sh
script:#!/bin/bash
./configure \
--prefix=/opt/php
--enable-intl \
--enable-opcache \
--enable-mbstring \
--enable-bcmath \
--enable-soap \
--enable-zip \
--enable-pdo \
--enable-ftp \
--enable-cli \
--enable-inline-optimization \
--enable-exif \
--enable-gd-native-ttf \
--enable-libxml \
--enable-sockets \
--enable-calendar \
--enable-wddx \
--enable-pcntl \
--enable-pthreads \
--with-config-file-path=/etc/php/ \
--with-config-file-scan-dir=/etc/php/conf.d/ \
--with-curl \
--with-pdo-mysql \
--with-pdo-pgsql \
--with-pdo-sqlite \
--with-mcrypt \
--with-pear \
--with-openssl \
--with-iconv \
--with-mysql \
--with-mysqli \
--with-pgsql \
--with-mssql \
--with-zlib \
--with-gd \
--with-jpeg-dir=/usr \
--with-gettext \
--with-xmlrpc \
--with-xsl \
--with-tidy \
--with-pcre-regex \
--with-mhash \
--with-kerberos \
--with-pspell \
--with-bz2 \
--with-ldap \
--with-libdir=lib/i386-linux-gnu \
--enable-fpm \
--with-fpm-user=www-data \
--with-fpm-group=www-data
And now what do I do to make PHP-FPM work?!
I read at php.net that to enable PHP-FPM while compiling PHP you just need to use --enable-fpm
, but still got some doubts...
apt-get install php5-fpm
then?Show me some knowledge, please!
Upvotes: 0
Views: 1617
Reputation: 139
--enable-fpm
will install and enable php-fpmapt-get install php5-fpm
but I guess you can't use php-fpm with nginx when you finish your compile,because by default they will not configure by themselves.
php-fpm is a daemon,when a request send to php-fpm,it will response with php processor, and php-fpm listen port use TCP/IP, nginx access php-fpm by fastcgi, that's means you can use multiple version php, and use one nginx server access them.
this is my config files,I hope it can help you
https://github.com/liujin834/php7-configure/tree/master/etc
you can start nginx and php-fpm use a config file
nginx -c /opt/server/etc/nginx/nginx.conf
php-fpm -y /opt/server/etc/php/php-fpm.conf -c /opt/server/etc/php/php.ini
Upvotes: 1
Reputation: 2914
From PHP 5.3.3,php-fpm is distributed with PHP
--enable-fpm
just enable it,because it's a built-in sapi module$YOUR_PHP_INSTALL_DIR/sbin/php-fpm
is the FPM executable, just run it,default configuration is listen 127.0.0.1:9000
Upvotes: 1