Setup PHP
- Add the below software and repository
> sudo apt-get install software-properties-common
> sudo add-apt-repository ppa:ondrej/php
> sudo apt-get update - Install PHP 7.1
> sudo apt-get install php7.1
- Install common PHP modules
> sudo apt-get install php7.1 php7.1-cli php7.1-common php7.1-json php7.1-opcache php7.1-mysql php7.1-mbstring php7.1-mcrypt php7.1-zip php7.1-fpm
- Edit the php.ini file
> sudo vi /etc/php/7.1/cli/php.ini - in the php.ini file type /cgi. and hit enter to find the below line and edit
cgi.fix_pathinfo=0
- Restart the PHP 7.1 service
> sudo service php7.1-fpm restart - Edit the NGINX config to enable PHP
> sudo vi /etc/nginx/sites-enabled/default
Remove the comments from the below php settings
- Restart nginx service
> sudo service nginx restart - Enable PHP and nginx to start on reboot
> sudo systemctl enable nginx.service
> sudo systemctl enable php7.1-fpm.service