This was done on Ubuntu 15.10, though instructions should easily translate to other Debian/Ubuntu derivatives.
First, install the required packages:
$ apt-get install apache2 php-fpm5
$ apt-get install nginx php-fpm5