Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

vandan's avatar
Level 13

Class 'ZipArchive' not found

i try to file export but zipArchive error

here is my controller code

public function export() 
{
        return Excel::download(new libraryExport, 'library.xlsx');
    }

here is my libraryexport file

public function collection()
    {
        return Library::all();
    }
0 likes
7 replies
Sinnbeck's avatar

You need to have the zip extension installed in your php.

sudo apt install php7.2-zip
1 like
vandan's avatar
Level 13

@ftiersch

yes try this but error when try to install php 7.3

Command line option --enable-zip is not understood in combination with the other options

Sinnbeck's avatar

Did you run it using 7.3 ? My example was for 7.2 but as you just said, you are now running 7.3

1 like
vandan's avatar
Level 13

@sinnbeck

sorry but i cant find php7.2 zip file can you please share link how to download 7.2 zip file

vandan's avatar
vandan
OP
Best Answer
Level 13

@ftiersch @sinnbeck thank you so much for helping me

i have run this command to zip file installation

sudo apt-get install php-zip and its working

Please or to participate in this conversation.