1. MagicESP
  2. Ubuntu Server 18.04
  3. Install PHP on Ubuntu 16.04

Install PHP on Ubuntu 16.04

Synonyms:
  1. PHP

Install php-cli and php-fpm

sudo apt -y install php-cli php-fpm php-json php-mbstring php-gd php-zip php-pear php-curl php-mcrypt 
sudo apt -y install php-memcached memcached
sudo apt -y install php-pgsql
sudo apt -y install php-mysql
sudo apt -y install php-imagick
  • php-fpm config file: /etc/php/7.0/fpm/pool.d/www.conf
  • php-fpm listen to unix socket: unix:/var/run/php/php7.0-fpm.sock.
  • php-fpm php.ini file: /etc/php/7.0/fpm/php.ini

Edit php-fpm config file (optional)

sudo {{ texteditor.value }} /etc/php/7.0/fpm/pool.d/www.conf

Edit OPcache in php.ini config file (optional)

sudo {{ texteditor.value }} /etc/php/7.0/fpm/php.ini
opcache.enable=1
opcache.enable_cli=1
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
opcache.revalidate_freq=60
opcache.fast_shutdown=1

refer to php doc