Skip to content

Instantly share code, notes, and snippets.

@trinvh
Created November 16, 2020 07:52
Show Gist options
  • Save trinvh/7dea2775d65f130fb9df39c85090556e to your computer and use it in GitHub Desktop.
Save trinvh/7dea2775d65f130fb9df39c85090556e to your computer and use it in GitHub Desktop.
# install php repository
add-apt-repository ppa:ondrej/php && apt update -y
# install php7.3 and extensions
apt install php7.3 php7.3-fpm php7.3-mbstring php7.3-zip php7.3-gd php7.3-mysql php7.3-curl
# configure php7.3-fpm default pool to run as nginx and listen on specific port instead of unix socket
# open config file with your favourite editor and replace `group www-data` and `user www-data` with `group nginx` and `user nginx`
# replace `listen /somewhere/php.sock` to `listen 9003`
# vim /etc/php/7.3/fpm/pool.d/www.conf
# restart php7.3-fpm service
systemctl restart php7.3-fpm
# configure nginx to pass cgi to php7.3-fpm
# vim /opt/nginx/site-enabled/xxx.conf replace `fastcgi_pass unix://var/run/php-fpmxxx` to `fastcgi_pass 127.0.0.1:9003`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment