This topic is locked
[SOLVED]

can not open .xlsx file from excel if upgrade to PHP 8.2

1/26/2023 12:10:52 AM
PHPRunner General questions
J
jackwood author

I try to upgrade from PHP 8.1 to PHP 8.2, and try export Excel file (.xlsx) from generate apps, i've got an error while opening the file (PHPR 10.9 (40502)).
PHP 8.1 => Success
PHP 8.2 => Corrupt

img alt

admin 1/26/2023

Open this XSLX file in Notepad and post the contents here.

J
jackwood author 1/26/2023

Hi Admin,
Thank you for the support.
here is the error after opening the file in the Notepad.



<b>Fatal error</b>: Uncaught Error: Class "ZipArchive" not found in C:\xampp\htdocs\sglv3\plugins\PHPExcel\Writer\Excel2007.php:226
Stack trace:

0 C:\xampp\htdocs\sglv3\include\export_functions_excel.php(163): PHPExcel_Writer_Excel2007->save('C:\xampp\htdocs...')

1 C:\xampp\htdocs\sglv3\include\export_functions.php(125): ExportExcelSave('ustatus_product...', 'Excel2007', Object(PHPExcel))

2 C:\xampp\htdocs\sglv3\classes\exportpage.php(227): ExportToExcel(Object(QueryResult), 0, Object(ExportPage))

3 C:\xampp\htdocs\sglv3\classes\exportpage.php(201): ExportPage->exportTo('excel', Object(QueryResult), 0)

4 C:\xampp\htdocs\sglv3\classes\exportpage.php(69): ExportPage->exportByType()

5 C:\xampp\htdocs\sglv3\ustatus_products_request_export.php(52): ExportPage->process()

6 {main}

thrown in <b>C:\xampp\htdocs\sglv3\plugins\PHPExcel\Writer\Excel2007.php</b> on line <b>226</b>

J
jackwood author 1/26/2023

Hi Admin,

after I check my php setting (xampp with php 8.2), I see the zip extension is not active.

find the ;zip extension and remove the ; mark, restart the apache webserver.

from ;extension=zip to extension=zip

it is working now.

Thank you.