Skip to content

Instantly share code, notes, and snippets.

@Snaver
Last active January 2, 2018 23:38
Show Gist options
  • Save Snaver/dd708abfcbd999dc591de1a93d0c9715 to your computer and use it in GitHub Desktop.
Save Snaver/dd708abfcbd999dc591de1a93d0c9715 to your computer and use it in GitHub Desktop.
Add PHP 7.1 to Ubuntu 14.04 Install (Default setup of mod_php 5.6 & Apache 2.4.7)

Add PHP 7.1 to Ubuntu 14.04 Install (Default setup of mod_php 5.6 & Apache 2.4.7)

https://wiki.apache.org/httpd/PHP-FPM

Steps

  • libapache2-mod-fastcgi isn’t free software so include separate repo

    • add-apt-repository multiverse
    • apt-get update
  • Install PHP 7.1

    • apt-get install php-fpm libapache2-mod-fastcgi
  • Switch default version back to 5.6

    • update-alternatives --config php
  • Enable apache modules

    • a2enmod proxy_fcgi setenvif
  • Tweak php-fpm setting in /etc/php/7.1/fpm/pool.d/www.conf

    • listen = 127.0.0.1:9000
  • Modify vhosts as required

    • # Redirect to local php-fpm instead of mod_php
    • ProxyPassMatch ^/(.*\.php)$ fcgi://127.0.0.1:9000/var/www/vhosts/laravel/public/$1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment