Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}'

Topics: Developer Forum, Project Management Forum, User Forum
Sep 24, 2009 at 11:33 AM
Edited Sep 24, 2009 at 11:47 AM

Please help.

I downloaded 1.7.0 and 1.6.6 and 1.6.4 and I am always getting the same result.

And this is pnly when I include

require_once 'Classes/PHPExcel/IOFactory.php';

Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /******/*******/*******/TEST-BETA/Classes/PHPExcel/IOFactory.php on line 53

 

The line number differs from version to another but I checked the line and it is

private static $_searchLocations = array(
        array( 'type' => 'IWriter', 'path' => 'PHPExcel/Writer/{0}.php', 'class' => 'PHPExcel_Writer_{0}' ),
        array( 'type' => 'IReader', 'path' => 'PHPExcel/Reader/{0}.php', 'class' => 'PHPExcel_Reader_{0}' )
    );

in version 1.6.4 the line is only private $_variable;

Can it be my php version, I am 1and1 and I do not know what version of PHP they are using.

If it is because of the php version, what can I do, I need to use a php lib where I can load an existing xls file, modify it and save it as another file.

Please advise.

 

Coordinator
Sep 24, 2009 at 11:42 AM

You can find what version of PHP you are running by creating a script containing

<?php phpinfo(); ?>

and running that

Sep 24, 2009 at 11:50 AM

thank you,

 

I am running with PHP 4.4.9 whereas PHPexcel requires >= 5.2

Any old versions, or any suggestions

 

Coordinator
Sep 24, 2009 at 12:03 PM

1&1 run servers with both PHP4 and PHP5

http://faq.oneandone.com/scripting_languages_supported/php/9.html

Oct 3, 2009 at 2:09 AM

thanks a lot