简体   繁体   English

PHP Excel 01simple-download-xlsx.php和07reader.php提供不同的输出

[英]PHP Excel 01simple-download-xlsx.php and 07reader.php giving different output

I am trying to run 2 example of PHPExcel 我正在尝试运行2个PHPExcel示例

01simple-download-xlsx.php and 07reader.php 01simple-download-xlsx.php和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. 01simple-download-xlsx.php可以正常工作,但是此示例07reader.php显示下面提到的错误,为什么自最近4个小时以来无法理解。 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 警告:require_once(../ Classes / PHPExcel / IOFactory.php):无法打开流:C:\\ xampp \\ htdocs \\ manazeschool \\ software \\ office_admin \\ exam_excel \\ Examples \\ 07reader.php中没有此类文件或目录

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 致命错误:require_once():无法在C:\\ xampp \\ htdocs \\ manazeschool \\ software \\中打开所需的'../Classes/PHPExcel/IOFactory.php'(include_path ='.; C:\\ xampp \\ php \\ PEAR')第37行的office_admin \\ exam_excel \\ Examples \\ 07reader.php

Some of the examples (such as the 01* files) correctly use an absolute pathname __DIR__ . '../Classes/...' 一些示例(例如01 *文件)正确使用了绝对路径名__DIR__ . '../Classes/...' __DIR__ . '../Classes/...' to include the main PHPExcel library, which means you don't need to be in the /Examples directory to run them. __DIR__ . '../Classes/...'以包含主要的PHPExcel库,这意味着您无需在/ Examples目录中即可运行它们。

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. 其他示例(包括07reader.php)仅使用相对路径名'../Classes/...'来包含主要的PHPExcel库,这意味着您必须在/ Examples目录中才能运行它们。

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. 要解决此问题,请在运行这些文件时确保您位于/ Examples文件夹中,或者将include修改为使用绝对路径名。

I believe I've now fixed all of these example files to use the absolute pathname in the development branch on github. 我相信我现在已经修复了所有这些示例文件,以便在github上的development分支中使用绝对路径名。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM