Skip to content
This repository has been archived by the owner on May 26, 2022. It is now read-only.

error in reading ziparchive through xmlreader #66

Closed
samirhshaikh opened this issue Jul 12, 2015 · 12 comments
Closed

error in reading ziparchive through xmlreader #66

samirhshaikh opened this issue Jul 12, 2015 · 12 comments
Labels

Comments

@samirhshaikh
Copy link

I am getting following error when system tries to read ziparchive through xmlreader.

XLSX Error: Could not open <file_location> for reading! (Could not open "xl/sharedStrings.xml".)

Error occurs in extractSharedStrings() function in /Reader/Helper/XLSX/SharedStringsHelper.php file in the line where it tries to read the shared string file.

if ($xmlReader->open($sharedStringsFilePath, null....

In my system, I first upload the file in a temporary location (which is /tmp folder) and then give that location to spout class for reading.

We are using Debian Linux configuration. I checked and we have got php_zip, php_xmlreader, and php_simplexml installed. I am using 1.0.10 version of spout class.

Please help.

@adrilo
Copy link
Collaborator

adrilo commented Jul 12, 2015

This seems like this issue is similar to what was fixed in #42. But this fix is part of the 1.0.10 version...
I just released a new version: 1.0.11. Can you give it a try?
Otherwise, it seems like a file-specific issue. If the new version does not fix your issue and if your file does not contain any sensitive/confidential data, can you please send it to me? adrien(at)box.com

@adrilo adrilo added the bug label Jul 14, 2015
@adrilo
Copy link
Collaborator

adrilo commented Jul 17, 2015

@samirhshaikh Did you get this issue resolved with the new version of Spout?

@samirhshaikh
Copy link
Author

Thanks for response. And apologies for delayed reply.

I updated to the latest version. But I am still getting the same error. It happens with all xlsx files. Even with the test files which comes with spout class. E.g. attact_billion_laughs.xlsx

@adrilo
Copy link
Collaborator

adrilo commented Jul 18, 2015

It's actually normal that it fails with the "attack_biliion_laughs.xlsx" but it should work with "one_sheet_with_shared_strings.xlsx" for instance.
If it does not, then it's definitely an environment issue. Can you then tell me which OS you are using as well as which PHP and libxml version? You can find those version using phpinfo().

Thanks!

@samirhshaikh
Copy link
Author

Its giving same error with one_sheet_with_shared_strings.xlsx as well. Following are the environment details:
OS: CentOS release 6.5
LibXML: 2.6.19
PHP: 5.5.26

Thanks.

@adrilo
Copy link
Collaborator

adrilo commented Jul 18, 2015

So I just tried and successfully managed to read a XLSX file on a config with:

  • CentOS 6.6
  • PHP 5.5.27
  • LibXML 2.7.6

I don't think the CentOS version makes any difference. Same for PHP as it's almost similar.
So I suspect that the problem should come from LibXML... @samirhshaikh can you upgrade the libxml library to see if it makes any difference?

Also, in your first message, you mentioned that you were using a "Debian Linux configuration". What did you mean by that? Were you talking about the OS?

@samirhshaikh
Copy link
Author

Debian Linux was the mistake. Sorry for that. I will upgrade LibXML version and try it out.

Thanks.

@adrilo
Copy link
Collaborator

adrilo commented Jul 22, 2015

@samirhshaikh Is it working better after upgrading libxml?

@samirhshaikh
Copy link
Author

My system admin on vacation. So cannot upgrade libxml. It will be a while before he comes back. Will update you after upgrading it. Hopefully it should work.

Thanks.

@adrilo
Copy link
Collaborator

adrilo commented Jul 23, 2015

Sounds good!

@adrilo
Copy link
Collaborator

adrilo commented Aug 21, 2015

@samirhshaikh Any update?

@adrilo
Copy link
Collaborator

adrilo commented Oct 15, 2015

Fixed with #126

@adrilo adrilo closed this as completed Oct 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants