Skip to content

Instantly share code, notes, and snippets.

@mauriciogofas
Forked from bobwol/easyengine-php7.3.md
Last active January 13, 2021 00:03
Show Gist options
  • Save mauriciogofas/ab123c58f8f2b56c7b39561f8487f76e to your computer and use it in GitHub Desktop.
Save mauriciogofas/ab123c58f8f2b56c7b39561f8487f76e to your computer and use it in GitHub Desktop.
Upgrade PHP to v7.3 in Ubuntu with Easy Engine #php #ubuntu #nginx #easyengine

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


Add php7.3 repository

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

Install php7.3-fpm

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

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

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

Edit the listening port of php7.3-fpm (for example 9073 instead of 9070)

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

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

service php7.3-fpm restart

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


1) Replace globally php7.0-fpm with php7.3-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:9073;

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

Then reload nginx

service nginx restart

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

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

upstream php73 {
server 127.0.0.1:9073;
}

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

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

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