Today I needed to install PHP7-fpm while keeping the default PHP5.5-fpm installed on an Ubuntu 14.04 server. I followed this tutorial:
http://www.tecmint.com/install-php7-for-apache-nginx-on-ubuntu-14-04/
To recap:
Add the php repository and update:
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
Install php and required modules:
sudo apt-get install php7.0
sudo apt-get install php7.0-fpm
sudo apt-get install php7.0-mysql php7.0-cli php7.0-gd php7.0-json
Then, in the vhost I needed php7, I added the following code:
Alias /php-fcgi /usr/lib/cgi-bin/php7
AddHandler php .php
Action php /php-fcgi
FastCgiExternalServer /usr/lib/cgi-bin/php7 -socket /var/run/php/php7.0-fpm.sock -pass-header Authorization -idle-timeout 600
AllowOverride All
Options +ExecCGI +FollowSymLinks
Require all granted
After restarting apache and php7-fpm, the site began running under php7. The other vhost on the server is still using the default php5.5 provided by the ubuntu packaging.