How to Install PHP 8.2 on Amazon AWS Linux 2

To install and configure php 8.2, 8.1, 8.0 on amazon aws Linux 2 server, You can enable and install it by using sudo amazon-linux-extras enable php8.2 and sudo amazon-linux-extras install php8.2 command on ssh terminal window or command line.

Here are steps to install PHP 8.2 on Amazon aws ec2 Linux 2 server:

Step 1 – Connect to Amazon Aws Linux 2 Server

To connect your Amazon AWS Linux 2 instance from putty ssh or aws terminal.

If you do not know how to connect amazon aws Linux 2 ec2 instance with Windows, Ubuntu, and Mac systems. Read this guide: How to Connect to ec2 Instance From Putty and SSH Terminal.

Step 2 – Update System Packages

It’s a good practice to update your system’s package list and upgrade existing packages:

sudo yum -y update

Step 3 – Install amazon-linux-extras

Let’s install amazon-linux-extras repository by using sudo yum install -y amazon-linux-extras command on amazon linux 2 ssh terminal:

sudo yum install -y amazon-linux-extras

Step 4 – Enable php8.2 on amazon-linux-extras

PHP 8.2 might be available in the default amazon linux extras repositories, Simply use sudo amazon-linux-extras enable php8.2 command on ssh terminal window to enable php8.2 on amazon linux 2 server:

sudo amazon-linux-extras enable php8.2

Step 5 – Install PHP 8.2 on Amazon Aws Linux 2

To install PHP 8.2 on Amazon Linux 2 server, Simply type sudo amazon-linux-extras install php8.2 command on ssh terminal window and press enter:

sudo amazon-linux-extras install php8.2

Now, again type sudo yum update command to update system:

sudo yum update

Step 6 – Verify the PHP Installation

To verify that PHP 8.2 is installed and configured correctly, simply type php –version command on ssh terminal window and press enter:

php --version

Conclusion

You’ve successfully installed PHP 8.2 on Amazon AWS Linux 2 server and added some common PHP extensions.

Recommended Tutorials

If you have any questions or thoughts to share, use the comment form below to reach us.

AuthorDevendra Dode

Greetings, I'm Devendra Dode, a full-stack developer, entrepreneur, and the proud owner of Tutsmake.com. My passion lies in crafting informative tutorials and offering valuable tips to assist fellow developers on their coding journey. Within my content, I cover a spectrum of technologies, including PHP, Python, JavaScript, jQuery, Laravel, Livewire, CodeIgniter, Node.js, Express.js, Vue.js, Angular.js, React.js, MySQL, MongoDB, REST APIs, Windows, XAMPP, Linux, Ubuntu, Amazon AWS, Composer, SEO, WordPress, SSL, and Bootstrap. Whether you're starting out or looking for advanced examples, I provide step-by-step guides and practical demonstrations to make your learning experience seamless. Let's explore the diverse realms of coding together.

Leave a Reply

Your email address will not be published. Required fields are marked *