Upgrade to latest Nginx and PHP-FPM on Ubuntu 16

Ubuntu 16 might be the most popular Ubuntu version (right now), so I put more effort on it. By default, the current Ubuntu 16.04 officially support PHP 7.0.x and Nginx 1.10.x versions. However as a crazy one who always wanna try latest releases, I cannot bear with it. So, below are steps help you upgrade to the latest Nginx and PHP-FPM on Ubuntu 16.04 server.

Use Nginx Mainline

  1. Add mainline to repo list:
  2. Install the new package:
  3. Check the new version with nginx -V.

Use ondrej/php

  1. Add the repo:
  2. Update repo list cache:
  3. Install PHP 7.2 and its modules:
  4. Install your custom module (such as ioncube-loader). Remember to load your ini at both fpm and cli folder.
  5. Set Default PHP version to 7.2:
  6. Stop/Disable PHP-FPM 7.0 and Start/Enable PHP-FPM 7.2:
  7. Done, test, enjoy (or debug :-P)

Leave a Reply