-
-
Notifications
You must be signed in to change notification settings - Fork 636
WAMP and Spout 2.8 XMLReader::open Issue #125
Comments
Hey @danddavi, is it working with other files? Like "one_sheet_with_shared_strings.xlsx"? |
I put everything back to original config and tried running "one_sheet_with_shared_strings.xlsx" |
https://gist.github.com/adrilo/a50b83814d119cf7a7fc |
Sure can you send me the link to download the "test.zip" file you want to test against. |
It is automatically created by the script |
Oops I should really read the whole code.. Warning: XMLReader::open(zip://test.zip#test.xml): failed to open stream: operation failed in C:\wamp\www\excel_reader_test\test.php on line 12 I am guessing its something on my end. Any ideas on what it can be? |
I updated the test code: https://gist.github.com/adrilo/a50b83814d119cf7a7fc |
Here is the errors. Everything failed. Warning: fopen(zip://test.zip#test.xml): failed to open stream: operation failed in C:\wamp\www\excel_reader_test\test.php on line 18 Warning: file_get_contents(zip://test.zip#test.xml): failed to open stream: operation failed in C:\wamp\www\excel_reader_test\test.php on line 29 Warning: XMLReader::open(zip://test.zip#test.xml): failed to open stream: operation failed in C:\wamp\www\excel_reader_test\test.php on line 40 |
Just FYI Your help is greatly appreciated.. |
Updated the Gist again. I added a test to check if the "zip" stream wrapper is registered. |
WooHoo So I see you used realpath() is that what needs to be done to all filepaths used by zip:// |
Yep, I guess Windows does not like relative paths... |
I used realpath($this->filePath) where 'zip://' was being used and that fixed the issue. SheetIterator.php Thanks for the great support!!!! |
No problem! Thanks for filing this issue :) |
I installed spout using composer.
Still having error on windows.
Warning: XMLReader::open(zip://xlsx_files/one_sheet_with_inline_strings.xlsx#xl/sharedStrings.xml): failed to open stream: operation failed in C:\wamp\www\excel_reader_test\vendor\box\spout\src\Spout\Reader\Wrapper\XMLReader.php on line 37
I have tried the suggested fix.
str_replace('/', DIRECTORY_SEPARATOR, $this->filePath)
Still same error except for the path
zip://xlsx_files\one_sheet_with_inline_strings.xlsx#xl/sharedStrings.xml
So I thought of changing the slash on the xml path
$str_xml = str_replace('/', DIRECTORY_SEPARATOR, self::SHARED_STRINGS_XML_FILE_PATH);
return 'zip://' . str_replace('/', DIRECTORY_SEPARATOR, $this->filePath) . '#' . self::SHARED_STRINGS_XML_FILE_PATH;
Same error. So I tried changing the slash in the constant.
const SHARED_STRINGS_XML_FILE_PATH = 'xl/sharedStrings.xml';
I got this error
Warning: file_get_contents(zip://xlsx_files\one_sheet_with_inline_strings.xlsx#[Content_Types].xml): failed to open stream: operation failed in C:\wamp\www\excel_reader_test\vendor\box\spout\src\Spout\Common\Helper\GlobalFunctionsHelper.php on line 167
Here is my setup.
Win 7
Apache 2.4.9
PHP 5.5.12
spout 2.3
PHP Info
libxml 2.9.1
zip 1.11.0
Libzip 0.10.1
zLib 1.2.7.3
Any Help would be greatly appreciated.
The text was updated successfully, but these errors were encountered: