0
Welcome Guest! Login
0 items Join Now

Solved - Fatal error: Call to undefined function mb_split()

  • Solved - Fatal error: Call to undefined function mb_split()

    Posted 5 years 6 months ago
    • I have seen other threads about this issue, but the solutions posted are not working for me. Everything indicates that mbstring is enabled on my server, which seems to be the root cause of this issue. When loading the frontend webpage I get the followoing error.

      Fatal error: Call to undefined function mb_split() in /home/user_removed/components/com_roksprocket/lib/RokSprocket/Util/HTMLManipulator.php on line 36

      I edited line 36 and changed it from
      $tokens  = mb_split("\s+", $content);
      to
      $tokens  = preg_split("/\s+/", $content);

      This allows me to load the webpage fine on the frontend which makes me think it is definitely an issue with mbstring, but I'm not sure what else to try. Could mbstring be enabled but not functioning correctly for some reason. Are there settings relevant to mbstring that would need to be modified or could be set incorrectly?

      Also, when loading the template manager on the backend I receive the following error.

      Fatal error: Call to undefined function mb_eregi() in /home/user_removed/libraries/rokcommon/phpQuery.php on line 1422

      I will post some of my settings in case it is helpful in suggesting what to try next. I have full access to all of the php and server configurations via WHM/cPanel virtual server setup.

      System Information
      PHP Built On Linux host.removed 2.6.18-194.17.1.el5 #1 SMP Wed Sep 29 12:50:31 EDT 2010 x86_64
      Database Version 5.1.68-cll
      Database Collation utf8_general_ci
      PHP Version 5.3.19
      Web Server Apache/2.2.23 (Unix) mod_ssl/2.2.23 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635
      WebServer to PHP Interface cgi-fcgi
      Joomla! Version Joomla! 3.0.3 Stable [ Ember ] 04-February-2013 14:00 GMT
      Joomla! Platform Version Joomla Platform 12.2.0 Stable [ Neil Armstrong ] 21-September-2012 00:00 GMT
      User Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0

      Relevant PHP Settings
      Safe Mode Off
      Open basedir None
      Display Errors On
      Short Open Tags On
      File Uploads On
      Magic Quotes Off
      Register Globals Off
      Output Buffering Off
      Session Save Path /tmp
      Session Auto Start 0
      XML Enabled Yes
      Zlib Enabled Yes
      Native ZIP Enabled Yes
      Disabled Functions None
      Mbstring Enabled Yes
      Iconv Available No
    • Last Edit: 5 years 6 months ago by Craig Fuoss.
    • prim's Avatar
    • prim
    • Preeminent Rocketeer
    • Posts: 17290
    • Thanks: 216

    Re: Solved - Fatal error: Call to undefined function mb_split()

    Posted 5 years 6 months ago
    • mb_eregi (and similar) is sort of a "core" function that most people compile into PHP so you have to contact your webhost so that they can fix this.
    • Please reply with a direct link to the issue & create a new thread for each new issue.

      A template is only as good as the content that goes into it ;) - DanG
  • Re: Solved - Fatal error: Call to undefined function mb_split()

    Posted 5 years 6 months ago
    • Thanks for the response. I ended up finding the root cause of the problem was not with mbstring which was enabled, it was with mbregex, which was disabled by default for some reason. I rebuilt apache/php with mbregex enabled and all is well.
    • The following users have thanked you: Charles Dyer

    • prim's Avatar
    • prim
    • Preeminent Rocketeer
    • Posts: 17290
    • Thanks: 216

    Re: Solved - Fatal error: Call to undefined function mb_split()

    Posted 5 years 6 months ago
    • Ok, cool - So we can mark this as solved now? :)
    • Please reply with a direct link to the issue & create a new thread for each new issue.

      A template is only as good as the content that goes into it ;) - DanG
  • Re: Solved - Fatal error: Call to undefined function mb_split()

    Posted 5 years 6 months ago
    • Yes, everything seems to be functioning without errors now.
    • OLAAZ's Avatar
    • OLAAZ
    • Newbie
    • Posts: 3
    • Thanks: 0

    Re: Solved - Fatal error: Call to undefined function mb_split()

    Posted 3 years 8 months ago
    • please explain to me step by step how you did it. I have thesame problem
  • Re: Solved - Fatal error: Call to undefined function mb_split()

    Posted 2 years 5 months ago
    • For those whose hosting company will not make changes reference mbstring or mbregex, this is the solution I patched together:
      for the errors of:
      Call to undefined function mb_split()
      Call to undefined function mb_eregi()



      Use Craig Fuoss's edit of
      /components/com_roksprocket/lib/RokSprocket/Util/HTMLManipulator.php on line 36

      Line 36 and change from
      $tokens  = mb_split("\s+", $content);
      to
      $tokens  = preg_split("/\s+/", $content);

      then since that causes RokCommon errors:
      /libraries/rokcommon/phpQuery.php

      Line 1422 and change from
      return extension_loaded('mbstring') && phpQuery::$mbstringSupport
      			? mb_eregi('\w', $char)
      			: preg_match('@\w@', $char);
      to
      			preg_match('@\w@', $char);


      Line 1838 and change from
      				//$isTag = extension_loaded('mbstring') && phpQuery::$mbstringSupport
      					//? mb_ereg_match('^[\w|\||-]+$', $s) || $s == '*'
      					//: preg_match('@^[\w|\||-]+$@', $s) || $s == '*';
      to
      				$isTag = preg_match('@^[\w|\||-]+$@', $s) || $s == '*';


      Hope that helps someone else since I wasted time messing with it.
    • Last Edit: 2 years 5 months ago by YellowWebMonkey.
    • The following users have thanked you: Rade, Matt

    • Alexis M. Priddy
      Owner/Senior Web Designer
      +1.512.271.5221 | This email address is being protected from spambots. You need JavaScript enabled to view it. |
      LinkedIn Profile
      YellowWebMonkey.com
    • Matt's Avatar
    • Matt
    • Preeminent Rocketeer
    • Posts: 20426
    • Thanks: 2889
    • messin' with stuff

    Re: Solved - Fatal error: Call to undefined function mb_split()

    Posted 2 years 5 months ago
    • You can also try adding this in your local php.ini

      extension=php_mbstring.dll
    • SEARCH the forum first! These boards are rich in knowledge and vast in topics :woohoo:
    • proton5's Avatar
    • proton5
    • Hero Rocketeer
    • Posts: 368
    • Thanks: 0

    Re: Solved - Fatal error: Call to undefined function mb_split()

    Posted 2 years 5 months ago
    • For me works just your first recommendation.

      I mean, I just do the modification in line 36:

      Fatal error: Call to undefined function mb_split() in /home/user_removed/components/com_roksprocket/lib/RokSprocket/Util/HTMLManipulator.php on line 36

      I edited line 36 and changed it from

      $tokens = mb_split("\s+", $content);

      to

      $tokens = preg_split("/\s+/", $content);

      Thank you very much!

Time to create page: 0.227 seconds