Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Parse error silverstripe/sapphire/core/SSViewer.php on line 219


Reply

8 Posts   2218 Views

Avatar
Jason

30 April 2007 at 3:25pm Community Member, 3 Posts

Hello Everyone,

I am getting the following error when trying to install silver stripe:

Parse error: syntax error, unexpected T_IF in /usr/home/solvetechnology.com/htdocs/silverstripe/sapphire/core/SSViewer.php on line 219

Now, my server has both php4 and php5 installed. 4 is the default version. In the htaccess file I have

AddType application/x-httpd-php5 .php

Do I need to add anything else? Is this the problem even at all?

Avatar
Sean

30 April 2007 at 7:53pm (Last edited: 30 April 2007 7:54pm), Forum Moderator, 921 Posts

Usually if it's using PHP 4 it'll give something like unexpected T_OBJECT_OPERATOR... which version of PHP 5 is the server using? I also assume you are using 2.0.1?

Avatar
Jason

1 May 2007 at 5:51pm Community Member, 3 Posts

I am using PHP Version 5.1.6. My whole php info file is here:

http://www.solvetechnology.com/phpinfo.php5

I am using the latest version of Silver stripe

Avatar
Jason

2 May 2007 at 4:52pm Community Member, 3 Posts

Anyone?

Avatar
abryan17

4 May 2007 at 3:47pm Community Member, 1 Post

I just had this problem as well... I "fixed" it by setting

asp_tags = Off

in my php.ini.

However, my install fails not long after that with a different error... hopefully you might have better luck.

Avatar
Willr

6 May 2007 at 1:12pm Forum Moderator, 5511 Posts

yes asp_tags has to be off for the SilverStripe <% if and control %> statements to function correctly. To turn the asp_tags setting off you will need to find your php.ini file and edit this line (It happens to be line 86 for me)

; Allow ASP-style <% %> tags.
asp_tags = Off

Avatar
Sam

6 May 2007 at 4:19pm Administrator, 685 Posts

Andrew - this is something that can be fixed, and probably should.

In SSViewer, replace references to "<%" and "%>" with '<'.'%' and '%'.'>'
This will prevent the strings from triggering the PHP tag code.

To test, you'll need to enable ASP style tags.

Avatar
Andy

7 May 2007 at 1:10pm 230 Posts

All done :)