📜 ⬆️ ⬇️

Installing PHP-FPM on Debian from packages

PHP-FPM - patch to PHP, providing an alternative interface FastCGI. Usually used with nginx in projects with high loads or lack of resources. For a convenient and simplified installation, we have compiled PHP-FPM into a package for Debian 5 Lenny. The last couple of weeks tested and tyunili, now laid out in public access. Over the packets in the sweat of his brow he worked vimil , to whom we together send out thanks and karma. Bugreport and comments are welcome, better comments on the post.

Installation Instructions



Install PHP-FPM from nginx to a minimal installation of Debian 5.

Setting up a new repository

Collected packages are in the repository ftp-pub.truevds.ru/pub/debian . Add a repository to the apt configuration - create the /etc/apt/sources.list.d/truevds.list file with the contents:
')
 deb ftp://ftp-pub.truevds.ru/pub/debian lenny main
 deb-src ftp://ftp-pub.truevds.ru/pub/debian lenny main


Import the key with which the packages are signed:

 apt-key adv - keyserver pgp.mit.edu - recv-key 44BEB7BE

or

 wget -O - ftp://ftp-pub.truevds.ru/pub/GPG_TRUEVDS_RU.KEY |  apt-key add -


In order to not reinstall PHP without a patch when upgrading the system, we will write the priority in the configuration file / etc / apt / preferences , we add:

 Package: *
 Pin: release a = stable
 Pin Priority: 900
 
 Package: php php *
 Pin: origin ftp-pub.truevds.ru
 Pin-Priority: 999


Update archive index files:

 apt-get update


Installation and configuration

Install PHP5 and nginx:

 apt-get install php5-cgi nginx

Editing / etc / nginx / sites-enabled / default - adds to the location section a binding of the .php extension to php-fpm:

               location ~ \ .php $ {
                       fastcgi_pass unix: /var/run/php-fpm/default.socket;
                       include fastcgi_params;
                       fastcgi_param SCRIPT_FILENAME $ document_root $ fastcgi_script_name;
               }

Start php-fpm and nginx:

 /etc/init.d/php-fpm start
 /etc/init.d/nginx start

The system is ready to go.

Health check

The default server directory for nginx is / var / www / nginx-default . To check if php works correctly, create a file with phpinfo () in it:

 echo '<? phpinfo ()?>'> /var/www/nginx-default/phpinfo.php

and open in the browser http: // IP-address_server /phpinfo.php. We get:



Ubuntu


For Ubuntu 9.10 Karmic there are assembled packages from Dreamcat4 . Actually, the installation instructions for PHP-FPM from there:

 wget https://launchpad.net/~dreamcat4/+archive/ppa/+files/php5-com_mon_5.2.10.dfsg.1-2ubuntu3~pre2_i386.deb
 dpkg --install php5-common_5.2.10.dfsg.1-2ubuntu3 ~ pre2_i386.deb

 wget https://launchpad.net/~dreamcat4/+archive/ppa/+files/php5-fpm_5.2.10.dfsg.1-2ubuntu3~pre2_i386.deb
 dkpg --install php5-fpm_5.2.10.dfsg.1-2ubuntu3 ~ pre2_i386.deb


UPD (2009-12-17) Links curves. Repository:
 deb http://ppa.launchpad.net/dreamcat4/ppa/ubuntu karmic main 
 deb-src http://ppa.launchpad.net/dreamcat4/ppa/ubuntu karmic main 

Or download directly from ppa.launchpad.net/dreamcat4/ppa/ubuntu/pool/main/p/php5

Touch it yourself


With this package we have compiled a special Optimized PHP preset that is collected and configured for nginx, php-fpm, eaccelerator, mysql and memcached to work. To launch the site, it is enough to upload it via FTP. Now this preset is in beta status.

Under his testing equipment is reserved and we can provide several dozens of servers c 256 Mb RAM / 480 MHz CPU with this preset for free for a month. You can see how your sites will behave on a bunch of nginx + php-fpm, you can just see what nginx is with php-fpm. Offer only for habrauser with positive karma. In one hand - one server. Applications for the server - a personal message with your email. In exchange, we need reports on various shortcomings, incomprehensibility, speed, and of general descriptions of sensations.

Source: https://habr.com/ru/post/78356/


All Articles