Skip to content

Instantly share code, notes, and snippets.

@VirtuBox
Last active June 14, 2021 19:50
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save VirtuBox/e215195d76b7549c32037045b01c17cf to your computer and use it in GitHub Desktop.
Save VirtuBox/e215195d76b7549c32037045b01c17cf to your computer and use it in GitHub Desktop.
How to install php7.1-fpm with EasyEngine

How to install php7.1-fpm with EasyEngine


Install php7.1-fpm

apt install php7.1-common php7.1-cli php7.1-zip php7.1-opcache php7.1-mysql php7.1-mcrypt php7.1-mbstring php7.1-json php7.1-intl php7.1-gd php7.1-fpm php7.1-curl php7.1-bz2

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

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

Edit the listening port of php7.1-fpm (for example 7080 instead of 7070)

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

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

service php7.1-fpm restart

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


1) Replace globally php7.0-fpm with php7.1-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:9080;
Then reload nginx


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

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

upstream php71 {
server 127.0.0.1:9080;
}

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

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

@inspiredearth
Copy link

Thanks for this. I just wanted to point out that in EE 3.8.x (at least) there is no include common/php7.conf in the vhosts file.

@hasinhayder
Copy link

Yes, on debian you just have to add deb sury repository to install php7.1/7.2 :

apt-get install apt-transport-https lsb-release ca-certificates
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list
apt-get update

@jorgept
Copy link

jorgept commented Jan 9, 2019

Hi,
In Ubuntu 18.04...
you can explain better the point 2)
when you mencioned

then copy the files /etc/nginx/common/php7.conf into /etc/nginx/common/php71.conf
And into this copy replace the line fastcgi_pass php7; by fastcgi_pass php71;
Reload nginx and you can replace the line include common/php7.conf; by include common/php71.conf; in the vhosts of your choice

Where is vhosts file?

thank you

@Psycharmor
Copy link

If you still having a hard time find this greate explanation

https://github.com/Delgesh/php7.1/

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