Cant able to read Excell 2007 file (.xlsx) file on Server

Topics: Developer Forum, Project Management Forum, User Forum
Feb 24, 2010 at 7:06 AM

Hello

When i tried to read data for Excel 2007 File Format i got below error, But the same is working in my local System.


Notice: Trying to get property of non-object in /home/apmweb/public_html/APMDev/test/Classes/PHPExcel/Reader/Excel2007.php on line 356

Warning: Invalid argument supplied for foreach() in /home/apmweb/public_html/APMDev/test/Classes/PHPExcel/Reader/Excel2007.php on line 356


In my local System  Zip Library Version is 2.0.0

Zip

enabled

Extension Version

$Id: php_zip.c,v 1.1.2.33 2007/05/19 22:25:11 pajoye Exp $

Zip version

2.0.0

Libzip version

0.7.1

 

But In the Server Zip Library Version is 1.8.10

Zip

enabled

Extension Version

$Id: php_zip.c,v 1.95.2.6 2007/05/19 22:35:49 pajoye Exp $

Zip version

1.8.10

Libzip version

0.7.1


I think this might be the problem at the time of reading Excel 2007

I will be very thankful, if some one help me

 

Thanks & Regards

Rakesh

 

Developer
Mar 19, 2010 at 3:49 AM

What version of PHPExcel are you using? If you are not using the latest version, can you try that one?

Apr 28, 2010 at 4:40 AM
Edited Apr 28, 2010 at 4:50 AM

Hi, I'm also experiencing a similar problem using the latest version PHPExcel 1.7.2.  I got it working perfectly on the local server but on the remote server, I got an error.

The error message I got was:

Warning: Invalid argument supplied for foreach() in /home/abacusmind/public_html/prototype/Big5/phpexcel/Classes/PHPExcel/Reader/Excel2007.php on line 353

Fatal error: Call to a member function getCell() on a non-object in /home/abacusmind/public_html/prototype/Big5/b5_staff_list_events.php on line 64

 

Local server:

 

Zip enabled
Extension Version $Id: php_zip.c,v 1.1.2.49 2009/02/05 19:53:22 pajoye Exp $
Zip version 1.8.11
Libzip version 0.9.0

 

 

Remote server:

Zip enabled
Extension Version $Id: php_zip.c,v 1.1.2.38 2007/08/06 22:02:32 bjori Exp $
Zip version 2.0.0
Libzip version 0.7.1

Would appreciate if anyone has any ideas.  Thanks in advance.

Rgds,

Karen

 

Just wanted to add that I ran the first test script (01simple.php) on the remote server and came back with this error.  Hopefully it will mean something to someone.

11:43:28 Create new PHPExcel object 11:43:28 Set properties 11:43:28 Add some data 11:43:28 Rename sheet 11:43:28 Write to Excel2007 format 
Fatal error: Uncaught exception 'Exception' with message 'Could not close zip file /home/abacusmind/public_html/prototype/Big5/phpexcel/Tests/01simple.xlsx.' in /home/abacusmind/public_html/prototype/Big5/phpexcel/Classes/PHPExcel/Writer/Excel2007.php:400 Stack trace: #0 /home/abacusmind/public_html/prototype/Big5/phpexcel/Tests/01simple.php(77): PHPExcel_Writer_Excel2007->save('/home/abacusmin...') #1 {main} thrown in/home/abacusmind/public_html/prototype/Big5/phpexcel/Classes/PHPExcel/Writer/Excel2007.php on line 400

May 3, 2010 at 3:20 AM

After reading some other comments, I suspect that it's related to the PHP version.  On my local server (where it is working), it is ver 5.2.9 while on the remote server, it is  ver 5.2.4.  Can anyone confirm this?  Thanks everyone!

Coordinator
May 3, 2010 at 10:10 AM

PHPExcel requires PHP 5.2.0 or above, so both 5.2.4 and 5.2.9 should work.

From the error, it looks as though the lib_zip could be the problem, but not enough information to determine what that problem is