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.
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?
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?
I am using PHP Version 5.1.6. My whole php info file is here:
I am using the latest version of Silver stripe
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.
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
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.