How to Install PHP on AWS EC2?
Last Updated :
30 Nov, 2021
AWS or Amazon web services is a cloud service platform that provides on-demand computational services, databases, storage space, and many more services. EC2 or Elastic Compute Cloud is a scalable computing service launched on the AWS cloud platform. In simpler words, EC2 is nothing but a virtual computer on which we can perform all our tasks and we have the authority to configure, launch or even dissipate this virtual computer To know more about EC2 visit this page.
In this article we will learn how to install PHP on AWS EC2.
Prerequisite -
- AWS account.
- EC2 Instance.
- User with privileges to create Instance.
Follow the steps below to install PHP on AWS EC2 -
Step 1 - Create an AWS Elastic Cloud Compute Instance, to do so visit How-To-Create-EC2-Instance.
Step 2 - Start the EC2 instance that you have created in Step 1
Step 3 - Connect to your EC2 Instance by clicking on Connect Button
Step 4 - A prompt will pop up after connecting.
Step 5 - At first check, if PHP is already installed or not.
php --version
Step 6 - If PHP is not installed on your virtual machine then install the PHP using the following command
sudo apt install php7.4
Step 7 - A prompt will appear asking you for confirmation , press 'y' to confirm.
Step 8 - Wait for the process to end.
Step 9 -We have successfully installed PHP on our EC2 instance, to check if PHP is installed or not, verify using the following command.
php --version
Step 10 - To know the current version of PHP, use the following command.
apt search php7.*
In this way, we can install PHP on our EC2 instance using EC2 Instance Connect. And if you also use a free tier account, make sure you delete all the resources you have used before logging out.
Similar Reads
How to Install R on AWS EC2? R is widely used as a different programming language. There are several programming languages are present for different purposes. The C programming language is used to get basic knowledge in the programming field. Java programming language is used to get some deep knowledge of programming & its
7 min read
How to Install Python3 on AWS EC2? AWS or Amazon web services is a cloud service platform that provides on-demand computational services, databases, storage space, and many more services. EC2 or Elastic Compute Cloud is a scalable computing service launched on the AWS cloud platform. In simpler words, EC2 is nothing but a virtual com
3 min read
How to Install Go on AWS EC2? EC2 or Elastic Compute Cloud is a scalable computing service launched on the AWS cloud platform. In simpler words, EC2 is nothing but a virtual computer on which we can perform all our tasks and we have the authority to configure, launch or even dissipate this virtual computer.Go is an open-source,
2 min read
How to Install Python 2.8 on AWS EC2? AWS or Amazon Web Services is one of the biggest cloud services providers with a variety of services such as on-demand computational services, databases, storage space, etc. EC2 or Elastic Compute Cloud is one of its services which acts as an on-demand computing service on the cloud platform. From a
4 min read
How to Install Imagick for PHP on AWS EC2? AWS or Amazon web services is a cloud service platform. It provides on-demand computational services, databases, storage space, and many more services. EC2 or Elastic Compute Cloud is a scalable computing service launched on the AWS cloud platform. Or in other words, EC2 is a virtual computer on whi
2 min read