PHP5 modules
apt-get install php5-curl php5-gd php5-imagick php5-mysqlnd php5-redis php5-tidy php5-xmlrpc php5-xsl php5-pspell php5-recode php5-ming php5-imap php5-intl php5-mcrypt php5-memcache php5-memcached php5-zip
PHP7 modules
apt-get install php7.0-curl php7.0-gd php7.0-imagick php7.0-mysqlnd php7.0-redis php7.0-tidy php7.0-xmlrpc php7.0-xsl php7.0-pspell php7.0-recode php7.0-imap php7.0-intl php7.0-mcrypt php7.0-memcache php7.0-memcached php7.0-zip php7.0-mb
Gearman
If you want to do work in parallel tasks, to load balance processing, and to call functions between languages.
apt-get install php5-gearman gearman
About gearman:
Sending Emails in the Background
How to set a timeout for a gearman job
Increase Memory Limit
nano /etc/php5/fpm/php-fpm.conf
Add the following:
php_admin_value[memory_limit] = 512M php_value[memory_limit] = 512M
And also edit:
nano /etc/php5/fpm/php.ini
This value:
memory_limit = 512M