XAMPP PHP8 Zip

Problems with the Windows version of XAMPP, questions, comments, and anything related.

XAMPP PHP8 Zip

Postby traymond » 31. January 2023 17:28

I'm working on implementing the PhpSpreadsheet (https://phpspreadsheet.readthedocs.io/) on PHP 8, using XAMPP with PHP 8.0x (not 8.1). All's well until it actually tries to write the file, and gives the following error:

Fatal error: Uncaught Error: Class "ZipStream\Option\Archive" not found in C:\xampp\htdocs\<snip>\phpspreadsheet\vendor\phpoffice\phpspreadsheet\src\PhpSpreadsheet\Writer\Xlsx.php:549 Stack trace: #0 C:\xampp\htdocs\<clip>.php(2814): PhpOffice\PhpSpreadsheet\Writer\Xlsx->save('C:/ReportExport...') #1 {main} thrown in C:\xampp\htdocs\<clip>\phpspreadsheet\vendor\phpoffice\phpspreadsheet\src\PhpSpreadsheet\Writer\Xlsx.php on line 549


The underlying problem is that the Zip extension's not included with XAMPP. Following https://www.php.net/manual/en/zip.installation.php - I tried to download the DLL, but they're for PHP 7.3 or 7.4. I've tried all 4 of the 7.4 versions, without success.

Any hints/suggestions on how to get the ZipArchive working? Thanks in advance for your time.
traymond
 
Posts: 2
Joined: 31. January 2023 17:09
XAMPP version: V3.3.0
Operating System: Windows 10

Re: XAMPP PHP8 Zip

Postby Altrea » 31. January 2023 20:00

PHP 8.2 comes with zip extension, but you need to activate it first.
To do so please follow these steps:

  • open your \xampp\php\php.ini
  • search for the following line
    Code: Select all
    ;extension=zip
  • remove the leading ; so that the line looks this
    Code: Select all
    extension=zip
  • save the file
  • restart Apache
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11935
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: XAMPP PHP8 Zip

Postby traymond » 02. February 2023 17:29

Did that, no change. Still getting: "Fatal error: Uncaught Error: Class "ZipStream\Option\Archive" not found in ..."
traymond
 
Posts: 2
Joined: 31. January 2023 17:09
XAMPP version: V3.3.0
Operating System: Windows 10

Re: XAMPP PHP8 Zip

Postby Altrea » 02. February 2023 19:39

So probably a third party application problem?
https://github.com/PHPOffice/PhpSpreadsheet/issues/1617
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11935
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 202 guests