Install PHP 7 on Ubuntu 14.04 with Gearman support

PHP 7 has been out long enough now that it has seen a couple of patch releases, which is about the time I will start evaluating an upgrade. PHP 7 can have some significant performance benefits from previous versions, so I was eager to give it a try. With the php-gearman extension now available for PHP 7, my prerequisites have been met.

Install latest PHP 7.0 on Ubuntu 14.04

sudo add-apt-repository -y ppa:ondrej/php
sudo apt-get update  
sudo apt-get -y install php7.0 php7.0-fpm php-gearman

Install additional extensions as needed

# common extensions
sudo apt-get -y install php7.0-curl php7.0-json php7.0-mcrypt php7.0-xml
# memcached and mongodb extensions
sudo apt-get -y install php-memcached php-mongodb

This PPA is maintained by Ondřej Surý. I have used his PHP Debian packages for several years without issue.