0

I'm trying to install Laravel in a Ubuntu Server 18.04 and I've already have installed Apache2, PHP and MySQL Server.

These are the versions:

Apache2:

Server version: Apache/2.4.29 (Ubuntu)
Server built:   2019-04-03T13:22:37

PHP:

PHP 7.2.17-0ubuntu0.18.04.1 (cli) (built: Apr 18 2019 14:12:38) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.17-0ubuntu0.18.04.1, Copyright (c) 1999-2018, by Zend Technologies

But when I tried to install Laravel with Composer I have the following error:

Problem 1
    - Installation request for laravel/installer ^2.1 -> satisfiable by laravel/installer[v2.1.0].
    - laravel/installer v2.1.0 requires ext-zip * -> the requested PHP extension zip is missing from your system.

I've read that it's solved by doing this: (link)

sudo apt-get install php7.0-zip

# For php v7.1
sudo apt-get install php7.1-zip

# For php v7.2
sudo apt-get install php7.2-zip

Will solve the problem but I have this output when I try to install one of them:

Reading list of packages ... Done
Creating dependency tree
Reading the status information ... Done
E: The php-zip package could not be located

Any idea about what am I doing wrong?

Thanks!

miken32
  • 42,008
  • 16
  • 111
  • 154
HessianMad
  • 549
  • 7
  • 23
  • As you say, use `apt-get install php7.2-zip`. Your error message suggests you used `apt-get install php-zip`. – miken32 May 07 '19 at 20:55
  • apt-get has evolved over the years into just apt. On modern systems this will detect the php version, etc. try apt install php-zip and if you get permission denied, then try it with sudo – Tarek Adam May 07 '19 at 20:57
  • @miken32 I used both of them and same error... – HessianMad May 07 '19 at 21:18
  • @TarekAdam I've used sudo apt install php-zip and same error as using sudo apt-get install php-zip – HessianMad May 07 '19 at 21:18

1 Answers1

1

Using these commands solved the problem:

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.2
sudo apt-get install php7.2-zip
HessianMad
  • 549
  • 7
  • 23