php-awsHow can I use Yum to install PHP on an Amazon EC2 instance?
Yum is a package manager for Linux distributions that can be used to install PHP on an Amazon EC2 instance. The following steps can be used to install PHP on an Amazon EC2 instance using Yum:
- Update the Yum package manager:
sudo yum update
- Install the PHP packages:
sudo yum install php php-mysql
- Verify the installation by running the following command:
php -v
Output example
PHP 7.2.34 (cli) (built: Mar 24 2020 11:01:37) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
- Configure the PHP settings:
sudo vi /etc/php.ini
- Restart the Apache web server:
sudo service httpd restart
- Test the PHP installation by creating a PHP info page:
sudo vi /var/www/html/info.php
- Test the page by visiting the URL in a web browser:
http://<ec2-instance-ip>/info.php
Helpful links
More of Php Aws
- How do I use PHP to create a ZIP file on AWS?
- How can I use AWS and Zksync together with PHP?
- How can I use an AWS SQS Worker with PHP?
- How can I use the AWS API Gateway with PHP?
- How can I use AWS WAF to secure my PHP application?
- How can I use AWS PHP SDK without credentials?
- How can I use PHP to connect to an Amazon Aurora database?
- How do I generate an AWS Signature Version 4 with PHP?
- How do I determine the version of PHP I am running on AWS?
See more codes...