Error trying to install PHP 7.2 on Ubuntu

Asked

Viewed 1,117 times

0

It’s been almost two days that I’m trying to install PHP, but can’t.

I downloaded the package tar.xz from the official PHP website.

Execution tar xJf to unpack, but when it arrives in the ./configure the following errors appear:

Erros ao instalar o php7

I’ve researched both on google and here Stackoverflow but could not find any solution to this problem.

  • And why you do not install with apt-get?

  • Extract the file in a folder that does not contain spaces and then try again.

  • This enters as programming ?

  • 2

    @RBZ This question, in my opinion, can remain because it is related to "common tools among programmers"

2 answers

2

1


Like Valdeir remembered well, if your Ubuntu is 17.10 or lower follow these steps:

Make sure you have the following package installed so you can add repositories:

apt install python-software-properties

Add the Ondřej repository

add-apt-repository ppa:ondrej/php

That naughty update

apt update

Installation of php 7.2:

Apache and Zip installation

apt install -y apache2 zip 

Installation of PHP and some extensions

apt-get install -y php7.2-mysql php7.2-curl php7.2-json php7.2-cgi php7.2 php7.2-mbstring libapache2-mod-php7.2 php7.2-ldap php-xdebug wget

Creation of the info.php file

echo "<?php phpinfo() ?>" > /var/www/html/info.php

Remembering: service apache2 start // inicia o serviço do apache

  • 1

    If your Ubuntu is 17.10 or lower, you don’t support PHP7.2, only PHP7.1 or lower. To install PHP7.2, it would have to add a repository, for example, ondrej/php before doing so.

  • Thanks Valdier, I had forgotten this detail, updated reply.

Browser other questions tagged

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