Laracon EU Online 2021


PHP 5.2.0 ve sonrası

Linux sistemleri

Bu işlevleri kullanmak için PHP'yi --enable-zip yapılandırma seçeneğini kullanarak zip desteğiyle derlemelisiniz.

PHP 5.6.0 itibariyle sistemin libzip kurulumunu kullanmak için --with-libzip=DİZİN yapılandırma seçeneği eklenmiştir. Libzip 0.11 gerekli olup, 0.11.2 ve sonrası tavsiye edilir.


Windows kullanıcıları bu işlevleri kullanabilmek için php.ini içinde php_zip.dll'i etkin kılmalıdır.

PECL üzerinden kurulum

Bu PECL eklentisini kurma bilgisi kılavuzun PECL eklentisinin kurulması başlıklı faslında bulunabilir. Yeni dağıtımlar, indirmeler, kaynak dosyaları, sürdürücü bilgileri ve CHANGELOG gibi ek bilgiyi şu adreste bulabilirsiniz: »

add a note add a note

User Contributed Notes 5 notes

4 months ago
This is how I installed it on my machine (ubuntu):
php 7:

sudo apt-get install php7.0-zip

service apache2 restart
1 year ago
Getting error

  configure: error: Please reinstall the libzip distribution

when compiling this extension for php 7.3?

You need to install the 'libzip' package.

In Dockerfile you would do this like:

# Install zip
RUN apt-get update && \
     apt-get install -y \
         libzip-dev \
         && docker-php-ext-install zip
php dot net at cage dot is
5 months ago
For those of you asking about how to update this within your Dockerfile, the answer seems to be to add to the environment variable like so:

ENV PHP_EXTRA_CONFIGURE_ARGS="--with-apxs2 --disable-cgi --with-zip"
sgalyen at notspamarizona dot edu
7 months ago
In trying to compile PHP 7.4.x on CentOS 7.x I'm running into the dreaded "Package requirements (libzip >= 0.11) were not met"

As the referenced RPM package for lipzip 0.11.2 is a 3rd party (repo named Psychotic Ninja Plus, doesn't exactly inspire faith) I tried to compile from source. 

I was able to find the git sha1 for 0.11.1 and compile successfully - if anyone needs it:

If someone in the know could post the sha1 for 0.11.2, or whatever preferred version of libzip that successfully compiles, I would appreciate it!
mattcasiro at gmail dot com
2 years ago
If installing this in a Docker image using:
"docker-php-ext-install zip"

you may get an error such as:
"docker-php-ext-install zip returned a non-zero code: 1"
"zip support requires ZLIB"

Docker documentation now suggests this as the proper way to install, to ensure the dependant libraries are installed with it:
# Install zip
RUN apt-get update && \
     apt-get install -y \
         zlib1g-dev \
         && docker-php-ext-install zip
To Top