How to install PHP 7.1 on EC2 running on Amazon Linux AMI 2018.03 having nginx as web server?

Ramratan Gupta picture Ramratan Gupta · Jul 13, 2017 · Viewed 20.1k times · Source

How to install PHP 7.1 on Amazon EC2 t2.micro Instance running Amazon Linux AMI 2018.03 having nginx as web server?

Reference to PHP7

Answer

Arun Basil Lal picture Arun Basil Lal · Sep 2, 2017

With reference to this answer, change Step 1 to the following:

1. Install Apache 2.4 and PHP 7.1 on Amazon Linux AMI

# Remove current apache & php 
sudo yum remove httpd* php*

# Install Apache 2.4
sudo yum install httpd24

# Install PHP 7.1
sudo yum install php71

# Install additional commonly used php packages
sudo yum install php71-gd
sudo yum install php71-imap
sudo yum install php71-mbstring
sudo yum install php71-mysqlnd
sudo yum install php71-opcache
sudo yum install php71-pdo
sudo yum install php71-pecl-apcu

Basically replacing php70 with php71.

Continue with step 2 and the rest as per the original tutorial.