1

What is the preferred/recommended way of installing php-fpm on debian for use with nginx? I read about a "php5-fpm" package everywhere, but it's not available in the official debian repos any more.

The PHP-FPM website (http://php-fpm.org/download/) says that fpm is now included with the php core. Is it enough to install "php5-common" then? Where are the config files, though?

Other people recommend to install the current version of php and php-fpm from dotdeb.org. The versions provided there are generally more up to date. But is it secure? Is this a good repo to use in a production environment?

I would appreciate any advice.

2 Answers 2

1

PHP5-FPM is being shipped with the core PHP project since June 2010, but has only granted the non-experimental status since the 5.4.0RC2 release less than a year ago.1 For Debian, it is available in Wheezy (now testing) and up2, as it hasn't made the Squeeze release. It might be available in the 'official' squeeze-backports some day, but that will still be PHP 5.3.x.

For now you'll have to stick with custom builds like the ones on dotdeb.org if you need to run Debian Squeeze and don't want to compile it all yourself.

FYI, Ubuntu has already released three stable releases including PHP-FPM.3

2
  • Thanks for your advice. So I think, I will use the dotdeb.org packages with priority based apt sources as described here: serverfault.com/questions/22414/…. Let me know if its a bad idea or if I could do anything else to ensure my setup is secure and production-ready.
    – Jelko
    Nov 13, 2012 at 17:33
  • I got everything working using apt-pinning. To help everybody else out, I posted my solution below as a separated answer.
    – Jelko
    Nov 14, 2012 at 12:34
0

As suggested in the first answer I used the packages from dotdeb.org. To prevent apt from installing all available packages from this repo generally, I used apt-pinning in /etc/apt/preferences as suggested in this answer.

My settings look like this:

security.pref

Pin: release l=Debian-Security
Pin-Priority: 1000
Package: *

stable.pref

Pin: release a=stable
Pin-Priority: 990
Package: *

dotdeb.pref

Package: *
Pin: release o=packages.dotdeb.org
Pin-Priority: 100

Package: libapache2-mod-php5 libapache2-mod-php5filter php-pear php5-cgi php5-cli php5-common php5-curl php5-dbg php5-dev php5-enchant php5-fpm php5-gd php5-gmp php5-imap php5-interbase php5-intl php5-ldap php5-mcrypt php5-mysql php5-odbc php5-pgsql php5-pspell php5-recode php5-snmp php5-sqlite php5-sybase php5-tidy php5-xmlrpc php5-xsl php5
Pin: release o=packages.dotdeb.org
Pin-Priority: 991

(create your sources.list files accordingly as shown in the linked answer above.)

With this setup the dotdeb packages never get installed by default (since security has still a higher priority) and all "non-php" (like nginx, redis, mysql, ..) packages aren't installed at all. (priority: 100)

To install your (wanted) php-packages run apt-get with -t to specify the repository to install from, e.g. like this:

apt-get install -t stable php5-fpm php5-common php5-cgi

(remember that you have to include all dependencies in your install statement!)

You can of course adjust this setup according to your situation. Hope this helps to get you on the right track.

Read more about apt-pinning in this guide and on the man page.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .