Jump to:

546 Posts in 2222 Topics by 237 members

Hosting Requirements

SilverStripe Forums » Hosting Requirements » forced and random mbstring.func_overload

What you need to consider when choosing a hosting provider and plan.

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

Page: 1 2 3
Go to End
Author Topic: 8764 Views
  • UncleCheese
    Avatar
    4085 Posts

    Re: forced and random mbstring.func_overload Link to this post

    Interesting. The in the live environment I just get a blank screen instead of a warning message. Man, what a headache.

  • rndmerle
    Avatar
    Community Member
    24 Posts

    Re: forced and random mbstring.func_overload Link to this post

    You mean that you get a blank page when the warning triggers and you get it by email ? And the rest of the time the page displays correctly ?
    It's weird because my pages always display correctly, even when a warning triggers.

  • UncleCheese
    Avatar
    4085 Posts

    Re: forced and random mbstring.func_overload Link to this post

    I've never gotten my page to display. It throws the warning in dev mode and a blank page in live mode. Checked the error logs and everything. There are no fatal errors. Agh..

  • rndmerle
    Avatar
    Community Member
    24 Posts

    Re: forced and random mbstring.func_overload Link to this post

    To avoid this problem, you could try to replace :

    $shiftCount = substr_count($pattern, '/', 0, $doubleSlashPoint) + 1;


    By :

    $shiftCount = substr_count( array_shift( split('(//)', $pattern ) ), '/' ) + 1;


    On line 303 in sapphire/core/control/HTTPRequest.php

    Because my site still works properly, I'm looking for a better solution to this issue.

  • rndmerle
    Avatar
    Community Member
    24 Posts

    Re: forced and random mbstring.func_overload Link to this post

    Well. My host's technical service has been actively looking for a solution but with no success :/
    So, for now, I'm using the HTTPRequest.php code modification to avoid the issue.

  • rndmerle
    Avatar
    Community Member
    24 Posts

    Re: forced and random mbstring.func_overload Link to this post

    This fix is partial :/
    I forgot the mb_ereg_replace problem.
    For some reason it didn't cause me any "visual" trouble before, but now I get the white page, like you UncleCheese.
    The error is :

    [Warning] mb_ereg_replace() [function.mb-ereg-replace]: mbregex compile err: unmatched close parenthesis
    Line 494 in /var/www/vhosts/renaudmerle.fr/httpdocs/sapphire/core/SSViewer.php

    I don't see how to fix that, for now.

    This issue is really weird. One out of ten requests, on average, the server act as if it was configured with
    mbstring.func_overload = 7
    And thus, replacing regular str functions with mb_str function, which are not really compatible.

    I'm currently asking my host to completely deactivate Mbstring.
    We'll see..

    Regards.

  • UncleCheese
    Avatar
    4085 Posts

    Re: forced and random mbstring.func_overload Link to this post

    Great. Thanks for the updates. What exactly does the value of mbstring_func_overload mean, anyway? It might explain why my site is so intermittent with the problem, as well.

  • rndmerle
    Avatar
    Community Member
    24 Posts

    Re: forced and random mbstring.func_overload Link to this post

    It happens there is one error in the pattern of two regex in sapphire/core/SSViewer.php.
    Ereg_replace doesn't complain about it, but mb_ereg_replace (and preg_replace too) does. At lines 494 and 496, the last closed parenthesis of the pattern needs to be escaped

    ,\<\?= +([^\?]*) +\?\>) +%' . '>',


    becomes

    ,\<\?= +([^\?]*) +\?\>\) +%' . '>',

    I join a diff file.

    It seems I solved the 2 visible symptoms, but I still have no clue why mbstring randomly overload str functions :/

    I'm going to post two bugs report about this ereg error and about the substr_count modification in order to make it compatible with mb_substr_count.

    Attached Files
    8764 Views
Page: 1 2 3
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.