Error while reading file on the server

Topics: Developer Forum, Project Management Forum, User Forum
Nov 30, 2010 at 12:18 PM
Edited Dec 1, 2010 at 3:34 AM

Hi all,

       Well I am having a strange problem.Everything is working perfectly for me in the local machine with xampp and apache server having windows as operating system. But when I upload the same thing to the server which is linux based, the template file from where reading will take place is not happening.    I have provided the correct absolute path.I even have checked whether file exists or not, it is showing that file exists there.But don't know why it's not reading.

Showing some error as :- Class 'PHPExcel_Reader_Excel5_Escher' not found in /...some path../PHPExcel/Classes/PHPExcel/Reader/Excel5.php on line 618

I m using PHP version 5.2.9 and PHP Excel version 1.7.3.

The way the file path is given is like this :-

$objPHPExcel = PHPExcel_IOFactory::load($docRoot.'/folder_path/file_name.xls');

$docRoot is for absolute path.

As far as i am concern there is no problem with path.But don't know why it's not reading this.I have tried the other methods allso like:-

$objReader = new PHPExcel_Reader_Excel5();
$objPHPExcel = $objReader->load($docRoot.'/folder_path/file_name.xls');

but this also doesn't work.

Any body out there please help.I am in a real spot of bother here.

 

Thanks

Coordinator
Nov 30, 2010 at 10:05 PM

For some reason, the autoloader is failing to load the PHPExcel_Reader_Excel5_Escher, which should be in /var/www/vhosts/vrmtest.net/web_users/amit/pfizerCRS/pfizer_crash_mis/PHPExcel/Classes/PHPExcel/Reader/Excel5/Escher.php.

Can you show any code for setting the include path, and including the PHPExcel library.

Dec 1, 2010 at 3:36 AM
MarkBaker wrote:

For some reason, the autoloader is failing to load the PHPExcel_Reader_Excel5_Escher, which should be in /var/www/vhosts/vrmtest.net/web_users/amit/pfizerCRS/pfizer_crash_mis/PHPExcel/Classes/PHPExcel/Reader/Excel5/Escher.php.

Can you show any code for setting the include path, and including the PHPExcel library.

Here it goes

set_include_path($docRoot. '/folder name/PHPExcel/Classes/');
// Include PHPExcel
include $docRoot.'/folder name/PHPExcel/Classes/PHPExcel.php';

// Include IOFactory
include $docRoot.'/folder name/PHPExcel/Classes/PHPExcel/IOFactory.php';

// Create new PHPExcel object
$objPHPExcel = new PHPExcel();

Dec 1, 2010 at 10:17 AM

Hi Mark the error coming in PHPExcel/Classes/PHPExcel/Reader/Excel5.php is like this:-

if (!$this->_readDataOnly && $this->_drawingGroupData) {
            $escherWorkbook = new PHPExcel_Shared_Escher();
            $reader = new PHPExcel_Reader_Excel5_Escher($escherWorkbook); //----ERROR LINE---
            $escherWorkbook = $reader->load($this->_drawingGroupData);

Can you please have a check why this line is showing the error??

Coordinator
Dec 1, 2010 at 9:21 PM

As I said before, that line will show that error if the autoloader fails to load the PHPExcel_Reader_Excel5_Escher file. What I can't explain is why the autoloader is failing to work. Normally, that will only happen if there is some other framework or library involved in your application that has it's own autoloader that clashes with PHPExcel's autoloader.

Dec 2, 2010 at 4:33 AM

Thanks Mark for ur reply again.

Well It seems like there was some path problem.lAnd it is all set now. Everything is working normal.

Thanks for your feedbacks.It was a real help.

Thanks again,

MaK

Coordinator
Dec 2, 2010 at 8:48 PM

Glad you were able to resolve this