php | install

PHP


Install php

sudo apt-get install php-fpm php-cli php-json php-intl php-mbstring php-fpm php-gd php-imagick php-gmp php-bcmath php-curl php-xml php-zip php-yaml


Security related settings:

sudo nano /etc/php/7.2/fpm/pool.d/www.conf

Make sure you have this:

security.limit_extensions = .php

More security related settings:

sudo nano /etc/php/7.2/fpm/php.ini

and edit:

max_input_vars = 7

cgi.fix_pathinfo=0

Restart php:

sudo service php7.2-fpm restart

Note: These two might break some web apps like wordpress.
Reference:

serverfault

flexichat