[RESOLVED] phpMyAdmin Import Failure - Invalid or uninitialized Zip object
Posted by: ghostinthetoast (---.ph.ph.cox.net)
Date: October 09, 2020 03:41AM

Some background info:
Wampserver v. 3.2.3
PHP v. 7.3.21 (have tried nearly all 7.x versions, thinking that might be the issue)
All wampserver services are running
tmp folder has all read/write permissions (windows)


I'm trying to import an excel file through phpMyAdmin as the start of a database. I saved the excel file as an OpenDocument Spreadsheed (.ods) and used Notepad++ to convert this .ods file to the UTF-8 character set. On attempted import, I get the following 'warnings' reported, which are really fatal errors.


Warning in .\libraries\classes\ZipExtension.php#102
ZipArchive::getStatusString(): Invalid or uninitialized Zip object

Backtrace

.\libraries\classes\ZipExtension.php#102: ZipArchive->getStatusString()
.\libraries\classes\File.php#686: PhpMyAdmin\ZipExtension->getContents(
string 'C:\\wamp64\\tmp\\php55D5.tmp',
NULL,
)
.\libraries\classes\File.php#661: PhpMyAdmin\File->openZip()
.\import.php#502: PhpMyAdmin\File->open()
Warning in .\libraries\classes\ZipExtension.php#103
ZipArchive::close(): Invalid or uninitialized Zip object

Backtrace

.\libraries\classes\ZipExtension.php#103: ZipArchive->close()
.\libraries\classes\File.php#686: PhpMyAdmin\ZipExtension->getContents(
string 'C:\\wamp64\\tmp\\php55D5.tmp',
NULL,
)
.\libraries\classes\File.php#661: PhpMyAdmin\File->openZip()
.\import.php#502: PhpMyAdmin\File->open()



The 'Invalid or uninitialized Zip object' seems to be caused by a number of things from my searching; sometimes php syntax issues, but I can't solve for that because phpMyAdmin is writing the php in this instance.

Attempting to save this file as Windows-1252 character set, and then importing with that char set gives a different group of errors on attempted import:

Fatal error: Uncaught TypeError: Return value of PhpMyAdmin\Encoding::convertString() must be of the type string, bool returned in C:\wamp64\apps\phpmyadmin5.0.2\libraries\classes\Encoding.php on line 200

TypeError: Return value of PhpMyAdmin\Encoding::convertString() must be of the type string, bool returned in C:\wamp64\apps\phpmyadmin5.0.2\libraries\classes\Encoding.php on line 200

Thanks in advance for your help!



Edited 2 time(s). Last edit at 10/11/2020 07:12PM by Otomatic.

Options: ReplyQuote
Re: phpMyAdmin Import Failure - Invalid or uninitialized Zip object
Posted by: RiggsFolly (Moderator)
Date: October 09, 2020 05:23PM

Save the xls or xlsx file as a CSV file.

Then read This tutorial Or any other tutorial you find with a search criteria of "import csv file into MySQL"

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: phpMyAdmin Import Failure - Invalid or uninitialized Zip object
Posted by: ghostinthetoast (---.ph.ph.cox.net)
Date: October 09, 2020 05:28PM

Thanks for the reply RiggsFolly - this was my plan as a fallback, although some fields like marketing description, short (tech) description use commas within the field values. These would regretfully have to be removed and added back in manually later with this approach.

Options: ReplyQuote
Re: phpMyAdmin Import Failure - Invalid or uninitialized Zip object
Posted by: ghostinthetoast (---.ph.ph.cox.net)
Date: October 10, 2020 07:27PM

Again, really appreciate your help here - after a little data massaging, this worked for me to use a CSV instead of an ODS. Cheers!

Options: ReplyQuote


Sorry, only registered users may post in this forum.