Install Php7-FPM fast-cgi Ubuntu 17

Berikut cara menginstall php7-fpm mpm-event Ubuntu 17

Update source list ubuntu

deb http://mirrors.digitalocean.com/ubuntu trusty main multiverse
deb http://mirrors.digitalocean.com/ubuntu trusty-updates main multiverse
deb http://security.ubuntu.com/ubuntu trusty-security main multiverse

apt-get update

apt-get install php-fpm php-cli php-common php-mbstring php-gd php-intl php-xml php-mysql php-mcrypt php-zip

apt-get install libapache2-mod-fastcgi

a2dismod mpm_prefork

a2dismod php7.1
a2dismod mpm_prefork
a2enmod mpm_event

a2enmod fastcgi

a2enmod proxy

a2enmod actions fastcgi alias
a2enconf php7.1-fpm

service apache2 reload

systemctl restart php7.1-fpm.service

pico /etc/apache2/conf-available/php7.1-fpm.conf

<IfModule mod_fastcgi.c>
AddHandler php7.fcgi .php
Action php7.fcgi /php7.fcgi
Alias /php7.fcgi /usr/lib/cgi-bin/php7.fcgi
FastCgiExternalServer /usr/lib/cgi-bin/php7.fcgi -socket /var/run/php/php7.1-fpm.sock -pass-header Authorization -idle-timeout 3600
<Directory /usr/lib/cgi-bin>
Require all granted
</Directory>
</IfModule>

cek file php7.1-fpm.conf

pico /etc/apache2/conf-enabled/php7.1-fpm.conf

NB : isi file harus sama dengan conf-available/php7.1-fpm.conf

edit line

pico /etc/php/7.1/fpm/pool.d/www.conf

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

create file

touch /usr/lib/cgi-bin/php7.fcgi

chown www-data:www-data /usr/lib/cgi-bin/php7.fcgi

 

service apache2 reload

systemctl restart php7.1-fpm.service

 

 

 

Posted on: November 10, 2017, by :

Leave a Reply