PHP-FPM

Requirements

Sudo
PHP

Installation

PHP-FPM is automatically installed when PHP is installed.

Configuration

PHP-FPM requires a few small changes in its configuration file, so open it first (with your preferred text editor):

sudo ee /usr/local/etc/php-fpm.d/www.conf

Then find this line

listen = 127.0.0.1:9000

and change it into

listen = /var/run/php-fpm.sock

Next, find these lines

;listen.owner = www
;listen.group = www
;listen.mode = 0660

and uncomment them by removing the ‘;’

listen.owner = www
listen.group = www
listen.mode = 0660

Finally, enable and start PHP-FPM by running

sudo sysrc php_fpm_enable=YES
sudo service php-fpm start

Leave A Reply

Your email address will not be published. Required fields are marked *