Error Running on Linux

Topics: Developer Forum, Project Management Forum
Apr 10, 2009 at 3:08 PM
I've implemented Spreadsheet in my windows xp local xampp, it works fine, but web i uploaded to my linux apache server i get this error:

Parse error: syntax error, unexpected T_OBJECT_OPERATOR    on line 32.

 $objPHPExcel->getProperties()->setCreator( $pUser );

please help !
Developer
Apr 10, 2009 at 3:16 PM
What PHP version are you using? Maybe PHP4? Try to upgrade to latest PHP 5.2.9

Apr 10, 2009 at 3:43 PM
Hi koyama,

i'm using PHP Version 5.2.5... I cannot upgrade to PHP 5.2.9 because the linux server is from my webhosting provider.

thanks !
Developer
Apr 10, 2009 at 3:55 PM
This puzzles me. I thought PHP 5.2.5 would not have problems with that syntax.

What happens if you change from this:

$objPHPExcel->getProperties()->setCreator( $pUser );

to this:

$properties = $objPHPExcel->getProperties();
$properties->setCreator( $pUser );

Apr 10, 2009 at 4:36 PM
it's working !!... do u know why this is happening ?

thanks a lot !
Developer
Apr 10, 2009 at 4:44 PM
Can you double check your PHP version using phpinfo() ? It really looks like you have PHP 4.

Apr 10, 2009 at 5:47 PM
Koyama,

thanks a lot !!... y print out server variables an the response was: PHP Version 4.4.8

now i have to rewrite my code o ask for a php upgrade.