Skip to content

Instantly share code, notes, and snippets.

@bobwol
Last active January 24, 2022 12:39
Show Gist options
  • Save bobwol/7c4725187c01b15f8f84dc9d21ba941e to your computer and use it in GitHub Desktop.
Save bobwol/7c4725187c01b15f8f84dc9d21ba941e to your computer and use it in GitHub Desktop.

How to install php7.2-fpm with EasyEngine (Ubuntu)


Add php7.2 repository

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update

Install php7.2-fpm

apt install php7.2-common php7.2-cli php7.2-zip php7.2-opcache php7.2-mysql php7.2-mbstring php7.2-json php7.2-intl php7.2-gd php7.2-fpm php7.2-curl php7.2-bz2 php7.2-bcmath php7.2-imap php7.2-recode php7.2-soap php7.2-xml php7.2-imagick php7.2-memcache php7.2-memcached php7.2-igbinary php7.2-msgpack php7.2-redis

Copy the php7.2-fpm pool configuration from php7.0-fpm

cp -f /etc/php/7.0/fpm/pool.d/www.conf /etc/php/7.2/fpm/pool.d/www.conf

Edit the listening port of php7.2-fpm (for example 9090 instead of 9070)

nano /etc/php/7.2/fpm/pool.d/www.conf

Replace the line listen = 127.0.0.1:9070 by listen = 127.0.0.1:9090
Restart the service

service php7.2-fpm restart

Then to use php7.2-fpm, you have the choice between


1) Replace globally php7.0-fpm with php7.2-fpm

In this case just edit the file /etc/nginx/conf.d/upstream.conf and replace the line server 127.0.0.1:9070; by server 127.0.0.1:9090;

nano /etc/nginx/conf.d/upstream.conf

Then reload nginx

service nginx restart

2) Add php7.2-fpm as an additional php version

Add the following lines in /etc/nginx/conf.d/upstream.conf

upstream php72 {
server 127.0.0.1:9090;
}

then copy the files /etc/nginx/common/php7.conf into /etc/nginx/common/php72.conf
And into this copy replace the line fastcgi_pass php7; by fastcgi_pass php72;

Reload nginx and you can replace the line include common/php7.conf; by include common/php72.conf; in the vhosts of your choice

@jorgept
Copy link

jorgept commented Aug 27, 2019

BUGS&FEATURES: This PPA now has a issue tracker:
https://deb.sury.org/#bug-reporting

CAVEATS:

  1. If you are using php-gearman, you need to add ppa:ondrej/pkg-gearman
  2. If you are using apache2, you are advised to add ppa:ondrej/apache2
  3. If you are using nginx, you are advise to add ppa:ondrej/nginx-mainline
       or ppa:ondrej/nginx

any advice?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment