Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

<b>Fatal error</b>: Call to undefined function

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Smarty 3
View previous topic :: View next topic  
Author Message
httpete
Smarty Rookie


Joined: 05 Dec 2009
Posts: 27

PostPosted: Thu Feb 10, 2011 5:01 pm    Post subject: <b>Fatal error</b>: Call to undefined function Reply with quote

Gents,

<b>Fatal error</b>: Call to undefined function mb_split() in <b>/home/smith/Gt/trunk/src/web/external_lib/Smarty/plugins/shared.mb_str_replace.php</b> on line <b>30</b><br />

I stay right up to date off of svn trunk for our app, but I have to change this one call each time to @split instead of the mb_split. I don't get it since I am on the latest greatest php 5.3.5 right from Fedora distribution. Any suggestion?

Pete
Back to top
View user's profile Send private message
rodneyrehm
Administrator


Joined: 30 Mar 2007
Posts: 674
Location: Germany, border to Switzerland

PostPosted: Thu Feb 10, 2011 6:44 pm    Post subject: Reply with quote

I'm not following… you say your up-to-date (PHP5.3.5) but managed to throw out MBString?

mb_split() is a function of the Multibyte String PECL. You really really want that.

But in any case this should be resolved with Smarty 3.1. We've reworked the entire system for proper UTF-8 compatibility.

split() has been deprecated with 5.3.0 btw. You'd want to not rely on that anymore…
Back to top
View user's profile Send private message Visit poster's website
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Thu Feb 10, 2011 8:17 pm    Post subject: Reply with quote

Something I just read from another site:

Quote:
all RedHat based systems like Fedora and CentOS seem to have the mbstring extension build separately as an extra package called php-mbstring. And usually the problem you describe is solved by installing it.
Back to top
View user's profile Send private message Visit poster's website
Barak
Smarty n00b


Joined: 22 Mar 2011
Posts: 1

PostPosted: Tue Mar 22, 2011 11:22 pm    Post subject: Call to undefined function mb_split() in Reply with quote

solving this for me was uncommenting the ;extension=php_mbstring.dll in the php.ini file make sure you double check to see where the php.ini file is loaded from, this can be done with making a file with this command <?=phpinfo()?>, then at the beginning of the output of this file you can see the Loaded Configuration File path for the php.ini file, don't forget also to restart apache after changes have been made to the php.ini file
Back to top
View user's profile Send private message
jonyo
Smarty Rookie


Joined: 14 Feb 2011
Posts: 16

PostPosted: Fri Dec 02, 2011 3:31 pm    Post subject: Reply with quote

rodneyrehm wrote:
...
But in any case this should be resolved with Smarty 3.1. We've reworked the entire system for proper UTF-8 compatibility.


Version 3.1 is now out, and we had someone report this same error, on Smarty 3.1.5, except it's found on a different line 47 now (same filename). Is Smarty 3.1 meant to work on servers without MB extension loaded?

I know 3.1.6 was just released, I checked the changelog and nothing about this issue was mentioned. Also downloaded 3.1.6 and that file didn't have changes in it.
Back to top
View user's profile Send private message
jonyo
Smarty Rookie


Joined: 14 Feb 2011
Posts: 16

PostPosted: Mon Mar 05, 2012 8:13 pm    Post subject: Reply with quote

This still happens, I've found on servers that have MBString enabled, but have MB Regex disabled, this happens. If they don't have MB String at all, the stuff that detects MB string built into smarty kicks in and there is no problem.
Back to top
View user's profile Send private message
rodneyrehm
Administrator


Joined: 30 Mar 2007
Posts: 674
Location: Germany, border to Switzerland

PostPosted: Mon Mar 05, 2012 8:21 pm    Post subject: Reply with quote

jonyo wrote:
This still happens, I've found on servers that have MBString enabled, but have MB Regex disabled, this happens. If they don't have MB String at all, the stuff that detects MB string built into smarty kicks in and there is no problem.


How does one disable MB regex? I couldn't find any directive for that in the manual. The only way to throw out internal functions (I know of) is disable_functions. Please find out how mb_strlen() can be available but mb_split() not.

Anyways, to prevent Smarty from using MBString functions:
Code:
define('SMARTY_MBSTRING', 'false');
define('SMARTY_SMARTY_RESOURCE_CHAR_SET', 'ISO-8859-1');

_________________
Twitter
Back to top
View user's profile Send private message Visit poster's website
jonyo
Smarty Rookie


Joined: 14 Feb 2011
Posts: 16

PostPosted: Wed Nov 07, 2012 7:27 pm    Post subject: Reply with quote

rodneyrehm wrote:
jonyo wrote:
This still happens, I've found on servers that have MBString enabled, but have MB Regex disabled, this happens. If they don't have MB String at all, the stuff that detects MB string built into smarty kicks in and there is no problem.


How does one disable MB regex? I couldn't find any directive for that in the manual. The only way to throw out internal functions (I know of) is disable_functions. Please find out how mb_strlen() can be available but mb_split() not.

Anyways, to prevent Smarty from using MBString functions:
Code:
define('SMARTY_MBSTRING', 'false');
define('SMARTY_SMARTY_RESOURCE_CHAR_SET', 'ISO-8859-1');


I missed your reply, didn't realize "notify me when a reply is posted" is off by default on the forums! (or at least it was at time I originally joined in)

Anyways, to answer your question, how to have mb regex disabled when normal mb string is working... I ran into another client's host have this issue, and looking at the PHP info, the PHP was compiled with the option "--disable-mbregex" which apparently is a thing... Might need to add a separate check specifically for whether mb regex is disabled, it's not very often but it does come up and it is a built-in option for the MB string stuff.
Back to top
View user's profile Send private message
rodneyrehm
Administrator


Joined: 30 Mar 2007
Posts: 674
Location: Germany, border to Switzerland

PostPosted: Wed Nov 07, 2012 8:08 pm    Post subject: Reply with quote

Yeah, we've figured out that part and already fixed it in 3.1.12!
_________________
Twitter
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Smarty 3 All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP