ZipArchive' not found How can I add it to my DockerFile please


Hope I’m in the right forum, I’m a docker newbie…

I’m using phpexcel in my site.

I have this error :

Fatal error** : Class 'ZipArchive' not found in **/var/www/html/excel/phpExcel/PHPExcel/Writer/Excel2007.php** on line **227

because I have to move my site from one server to a new one (with DockerFile…)

I’m using PHPExcel, and like we can see in the error, ZipArchive is missing.

Do you know how can I include it below in my DockerFile please ?


LABEL maintainer="JBM<> && Developper"

USER root

# Add here your PHP ext
# Ex : RUN docker-php-ext-install mysql && docker-php-ext-enable mysql

Thank you in advance for your help

ZipArchive is the part of the official PHP images as of version 5.6. Since I don’t know anything about your image, I can’t say much, because the installation depends on the actual image.

Since your comment in your Dockerfile indicates that the image is based on the official image or at least similar to that, if the zip extension is missing, you should be able to install it the same way as mysql, except you probably don’t need to enable it. This is how I did it:

Although it was probably not necessary for me.