Skip to content

Instantly share code, notes, and snippets.

@proxium
Last active October 17, 2020 09:14
Show Gist options
  • Save proxium/9d6bb9f1a0263bdbba8b1e959f72537e to your computer and use it in GitHub Desktop.
Save proxium/9d6bb9f1a0263bdbba8b1e959f72537e to your computer and use it in GitHub Desktop.
Install PHP 7 on AWS EC2 Linux Instance
# Pick the topic name or number from the list below
#sudo amazon-linux-extras list
# 0 ansible2 disabled [ =2.4.2 ]
# 1 emacs disabled [ =25.3 ]
# 2 memcached1.5 disabled [ =1.5.1 ]
# 3 nginx1.12 disabled [ =1.12.2 ]
# 4 postgresql9.6 disabled [ =9.6.6 ]
# 5 python3 disabled [ =3.6.2 ]
# 6 redis4.0 disabled [ =4.0.5 ]
# 7 R3.4 disabled [ =3.4.3 ]
# 8 rust1 disabled [ =1.22.1 ]
# 9 vim disabled [ =8.0 ]
# 10 golang1.9 disabled [ =1.9.2 ]
# 11 ruby2.4 disabled [ =2.4.2 ]
# 12 nano disabled [ =2.9.1 ]
# 13 php7.2=latest enabled [ =7.2.0 ]
# 14 lamp-mariadb10.2-php7.2 disabled [ =10.2.10_7.2.0 ]
sudo amazon-linux-extras enable php7.2
sudo yum update
# check available php packages
yum list available '*php*'
# install desired packages (at your convenience)
sudo yum install php-json php-xml php-cli php-mbstring
@azazqadir
Copy link

It is not necessary to do all this manually if you want to host a dynamic website on AWS. There are tools to automate, like server provisioning tool Chef and Puppet. There are also PaaS that makes the process easier and simpler.

@proxium
Copy link
Author

proxium commented Dec 18, 2019

Should be:

yum list available 'php'

to get the full list (e.g. graphviz-php.x86_64 )

Ok, I updated the gist

@proxium
Copy link
Author

proxium commented Dec 18, 2019

It is not necessary to do all this manually if you want to host a dynamic website on AWS. There are tools to automate, like server provisioning tool Chef and Puppet. There are also PaaS that makes the process easier and simpler.

You are right, this is useful when you want to simply test or try something on AWS before using any provisioning tool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment