Jump to:

1131 Posts in 1965 Topics by 402 members

Upgrading SilverStripe

SilverStripe Forums » Upgrading SilverStripe » "Unexpected character in input..." error

Ask questions about upgrading SilverStripe to the latest version.

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

Page: 1
Go to End
Author Topic: 1455 Views
  • SightUnseen
    Avatar
    Community Member
    28 Posts

    "Unexpected character in input..." error Link to this post

    After upgrading from 2.3.3 to 2.4.0 the following is shown:

    Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/trainer/public_html/sapphire/core/SSViewer.php on line 304

    This appeared after a rebuild was carried out. Now it is not possible to do another, as attempts to login fail.

    Can anyone suggest the fix for this? The relevant block is:

          $content = ereg_replace('<' . '% +_t\((\'([^\.\']*)\'|"([^\."]*)")(([^)]|\)[^ ]|\) +[^% ])*)\) +%' . '>', '<?= _t(\''. $identifier . '.ss' . '.\\2\\3\'\\4) ?>', $content);

  • Bruce B
    Avatar
    Community Member
    145 Posts

    Re: "Unexpected character in input..." error Link to this post

    Try adding your current domain to the list of dev servers in your _config.php file. That way you can see what error message you get on a rebuild without needing to log in.

  • SightUnseen
    Avatar
    Community Member
    28 Posts

    Re: "Unexpected character in input..." error Link to this post

    Thanks Bruce, have done so and see in red:

    user_error('DataObjectDecorator::extraDBFields() is deprecated. Please use extraStatics() instead.', E_USER_NOTICE);

    To be honest, an upgrade shouldn't be this difficult. We have also tried a fresh install on a test server, then imported the database, which worked fine. However upon adding Blog, the User Form, and Mollum modules the same error arises. We've also asked this question a couple of times in the IRC channel and looked through the forums and help section, but it all appears support is targeted to advanced php developers only.

  • shan
    Avatar
    Community Member
    3 Posts

    Re: "Unexpected character in input..." error Link to this post

    Had the exact same issue. Upgrade from 2.33 to 2.40. Same situation same error message. (On a Networksolutions host, not sure if this matters). Had to restore to 2.33. Searched on the Internet, found this post and another post answered in Germany...
    Thanks in advance!

  • Cristian
    Avatar
    Community Member
    8 Posts

    Re: "Unexpected character in input..." error Link to this post

    make sure the ASP_TAG is OFF. that was the cause of my problem

    Also, some other config can cause this error :
    /tmp folder not writable.
    and safe_mod is on.

    <?php

    echo "TMP is_writable: " . is_writable("/tmp") . "<br />";
    echo "SafeMode: " . ini_get('safe_mode') . "<br />";
    echo "asp_tags: " . ini_get('asp_tags') . "<br />";

    phpinfo();
    ?>

    if that can help.

    -Cristian

  • shan
    Avatar
    Community Member
    3 Posts

    Re: "Unexpected character in input..." error Link to this post

    Worked! Thanks Cristian!
    ASP_TAG was on. Since I'm on a shared hosting with Networksolutions. I did this to turn it off: create the php.ini file under cgi-bin folder with only one line: asp_tag=Off.
    Unfortunately I had problems with my custom form after upgrading and had to downgrade AGAIN...

  • SightUnseen
    Avatar
    Community Member
    28 Posts

    Re: "Unexpected character in input..." error Link to this post

    This is now fixed, thanks to pelse here: http://www.silverstripe.org/installing-silverstripe/show/286353

    Thank you to all those who contributed.

    1455 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.