-2

Server runs PHP 8. This is the error message returned when attempting to deploy.

Your lock file does not contain a compatible set of packages. Please run composer update. Problem 1 - phpoffice/phpspreadsheet is locked to version 1.22.0 and an update of this package was not requested. - phpoffice/phpspreadsheet 1.22.0 requires ext-zip * -> it is missing from your system. Install or enable PHP's zip extension.

Here is the script section of my gitlab-ci.yml file, which is used to build the application.

   script:
    - apt-get update -yqq
    - apt-get install git nodejs libcurl4-gnutls-dev libicu-dev libmcrypt-dev libvpx-dev libjpeg-dev libpng-dev libxpm-dev zlib1g-dev libfreetype6-dev libxml2-dev libexpat1-dev libbz2-dev libgmp3-dev libldap2-dev unixodbc-dev libpq-dev libsqlite3-dev libaspell-dev libsnmp-dev libpcre3-dev libtidy-dev -yqq zip unzip
    - docker-php-ext-install pdo_mysql curl intl gd xml bz2 opcache bcmath
    - pecl install xdebug
    - docker-php-ext-enable xdebug
    - curl -sS https://getcomposer.org/installer | php
    - php composer.phar install
    - npm install
    - php artisan config:cache

How do i install PHP zip extension for PHP 8? i've tried:

apt get install zip, pecl install php-pecl-zip, apt get install libzip-dev, docker-php-ext-install zip, apt get install php-zip

None of these have worked. On local the above script section works with PHP 8 but doesn't work on AWS Ubuntu with PHP 8? How do i solve?

user892134
  • 3,078
  • 16
  • 62
  • 128

2 Answers2

1

You can install zip with following commands.

apt-get install -y libzip-dev zip  && docker-php-ext-install zip
Raftx24
  • 306
  • 5
  • 11
0

Try installing it with this command:

sudo apt-get install php8.0-zip

also you should probably restart your nginx/apache server as well as php-fpm

Marwane Ezzaze
  • 1,032
  • 5
  • 11
  • tried that earlier and didn't work: This was error message `E: Unable to locate package php8.0-zip E: Couldn't find any package by glob 'php8.0-zip' E: Couldn't find any package by regex 'php8.0-zip'` – user892134 Apr 17 '22 at 14:20