This article mainly introduces the Linux system PHP-FPM installation and configuration tutorial, PHP-FMP is used for PHP FastCGI manager, often used to configure PHP and server software, need a friend can refer to the next
Basic installation method
Installation Kit
$ sudo apt-get install python-software-properties
Add ppa source
$ sudo add-apt-repository ppa:yola/php5
Install php5-fpm
sudo apt-get update sudo apt-get install php5-fpm
Install other necessary software
sudo apt-get install nginx
Configure php-fpm
The php-fpm parser is in the C/S structure, and its configuration file is located:
(1)/etc/php5/fpm/php-fpm.conf
(2)/etc/php5/fpm/pool. d/
Generally, there are no strict configuration requirements, or I have not specifically studied the significance of each configuration parameter.
I used the tcp mode to connect to the fastcgi process, so I modified the address and port of the tcp listener and the name of the monitoring Directory. I will not explain it in detail here, you can refer to the official documentation for configuration based on your needs.
Restart php5-fpm
Solution to installation error
If there is no php5-fpm in the server's system source, a prompt will be prompted during installation:
Reading state information... Done
E: Couldn't find package php5-fpm
Solution
1. add unofficial sources to/etc/apt/sources. list
echo "deb http://ppa.launchpad.net/brianmercer/php/ubuntu lucid main" >> /etc/apt/sources.list echo "deb-src http://ppa.launchpad.net/brianmercer/php/ubuntu lucid main" >> /etc/apt/sources.list
2. install php5-fpm
sudo apt-get update && sudo apt-get install php5-fpm
3. install php extension components
sudo apt-get install php-apc php5-curl php5-gd php5-imagick php5-mysql\ php5-memcache php5-memcached php5-mcrypt
4. start php-fpm
sudo /etc/init.d/php5-fpm start
Php. in is located in/etc/php5/fpm/php. ini
Php-fpm.ini at/etc/php5/fpm/php5-fpm.conf
An error is reported when php-fpm is started.
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20060613+lfs/gd.so' - /usr/lib/php5/20060613+lfs/gd.so: undefined symbol: gdImageCreateFromJpeg in Unknown on line 0
Locate libgd: check the location of the gd dynamic library. if the/usr/local/lib/directory contains
rm /usr/local/lib/libgd*
Restart php-fpm.
Remove the warning message when php-fpm is started.
PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/fpm/conf.d/imagick.ini on line 1 in Unknown on line 0
Turn # into; to remove the prompt