Install PHP 7 on the AWS EC2 Linux server

Asked

Viewed 430 times

0

I am executing the following command:

sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt

My intention is to install PHP, but this turning the error:

>Lendo listas de pacotes... Pronto
>Construindo árvore de dependências       
>Lendo informação de estado... Pronto
>E: Impossível encontrar o pacote php7
>E: Impossível encontrar o pacote libapache2-mod-php7
>E: Impossível encontrar o pacote php7-mcrypt

I’m not finding anything on the internet about.

What should I do to complete the installation of my php server?

  • 1

    I don’t know if you’ve heard of LAMP (Linux, Apache, Mysql and PHP). if that is your intention (install all of them), take a look here -> http://lamphowto.com/

2 answers

2

I managed to solve with some tips.

The first is there is a command to check which versions of PHP have available, to perform this command just :

$ sudo apt-cache search php

So I found that I had to do the command like this:

$ sudo apt-get install php7.0 libapache2-mod-php7.0 php7.0-mcrypt

Making it possible to install my php7 normally.

0

sudo yum install -y amazon-linux-extras
sudo  amazon-linux-extras | grep php
sudo amazon-linux-extras enable php7.4
sudo yum clean metadata
sudo yum install httpd php

Replace the yum for apt-get depending on the system

Browser other questions tagged

You are not signed in. Login or sign up in order to post.