0
votes

I am trying to run 2 example of PHPExcel

01simple-download-xlsx.php and 07reader.php

01simple-download-xlsx.php Working Perfect but this example 07reader.php is showing error mentioned below Why can't understand since last 4 hours. Any one can kindly tell me why this is happening when the file is using same directory structure.

Warning: require_once(../Classes/PHPExcel/IOFactory.php): failed to open stream: No such file or directory in C:\xampp\htdocs\manazeschool\software\office_admin\exam_excel\Examples\07reader.php on line 37

Fatal error: require_once(): Failed opening required '../Classes/PHPExcel/IOFactory.php' (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\manazeschool\software\office_admin\exam_excel\Examples\07reader.php on line 37

1
It's telling you that the file C:\xampp\htdocs\manazeschool\software\office_admin\exam_excel\PHPExcel\IOFactory.php does not exist. - user3141031

1 Answers

0
votes

Some of the examples (such as the 01* files) correctly use an absolute pathname __DIR__ . '../Classes/...' to include the main PHPExcel library, which means you don't need to be in the /Examples directory to run them.

Other examples (07reader.php included) simply use a relative pathname '../Classes/...'to include the main PHPExcel library, which means you do need to be in the /Examples directory to run them.

To resolve the issue, either ensure that you're in the /Examples folder when you run these files, or modify the include to use the absolute pathname.

I believe I've now fixed all of these example files to use the absolute pathname in the development branch on github.