Optimize PHP settings for maximum performance

Configure OPCACHE

vi /etc/php/7.0/mods-available/opcache.ini

opcache.enable_cli=1
opcache.memory_consumption=512
opcache.max_accelerated_files=100000
opcache.validate_timestamps=0
opcache.consistency_checks=0

service php7.0-fpm restart

Configure APCU

sudo apt-get -y install php-dev
sudo apt-get -y install gcc make autoconf libc-dev pkg-config
pecl channel-update pecl.php.net
sudo pecl install apcu
#sudo pecl7.X-sp install apcu

vi /etc/php/7.0/mods-available/apcu.ini

[apcu]
apc.enabled = 1

ln -s /etc/php/7.0/mods-available/apcu.ini /etc/php/7.0/fpm/conf.d/20-apcu.ini
ln -s /etc/php/7.0/mods-available/apcu.ini /etc/php/7.0/cli/conf.d/20-apcu.ini
service php7.0-fpm restart