Author Topic: Call to undefined function mb_detect_encoding()  (Read 4302 times)

Tide

  • Newbie
  • *
  • Posts: 5
    • View Profile
Call to undefined function mb_detect_encoding()
« on: April 03, 2009, 10:37:26 AM »
I have uploaded a txt and a css file to Documents.  When I click on the item to view it I get an error in the box that is supposed to show the files text.

I have turned on DEBUG and this is the error I get:
Code: [Select]
<b>Fatal error</b>:  Call to undefined function  mb_detect_encoding() in <b>/home/dies/opengoo/application/controllers/FilesController.class.php</b> on line <b>1787</b><br />
If I click the text file icon to try and edit the file I get a blank Documents tab.

I have tried various permissions and ownership but to no avail.  Always the same error.

I believe I have mbstring enabled for php.

This is the configure statement for the box:
Code: [Select]
[root@host public_html]# php -i |grep mb Configure Command =>
'./configure' '--disable-pdo' '--enable-bcmath'
'--enable-calendar' '--enable-ftp' '--enable-libxml'
'--enable-magic-quotes' '--enable-mbstring'
'--enable-sockets' '--enable-zip'
'--prefix=/usr/local'
'--with-apxs2=/usr/local/apache/bin/apxs' '--with-gd'
'--with-imap=/opt/php_with_imap_client/'
'--with-imap-ssl=/usr' '--with-jpeg-dir=/usr'
'--with-kerberos' '--with-libxml-dir=/opt/xml2/'
'--with-mysql=/usr'
'--with-mysql-sock=/var/lib/mysql/mysql.sock'
'--with-png-dir=/usr' '--with-xpm-dir=/usr/X11R6'
'--with-zlib' '--with-zlib-dir=/usr' xmlrpc_error_number =>
0 => 0 mbstring Multibyte string engine => libmbfl mbstring extension
makes use of "streamable kanji code filter and converter", which is
distributed under the GNU Lesser General Public License version 2.1.
mbstring.detect_order => no value => no value
mbstring.encoding_translation => Off => Off mbstring.func_overload =>
0 => 0 mbstring.http_input => pass => pass mbstring.http_output =>
pass => pass mbstring.internal_encoding => ISO-8859-1 => no value
mbstring.language => neutral => neutral mbstring.strict_detection =>
Off => Off mbstring.substitute_character => no value => no value

I am running : Apache 2, PHP 5.2.6, Mysql 4.1.22

Any ideas on what it could be?

ignacio

  • Administrator
  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
Re: Call to undefined function mb_detect_encoding()
« Reply #1 on: April 07, 2009, 02:18:02 PM »
Upload a PHP file to your server containing:
Code: [Select]
<?php phpinfo() ?>
There you will be able to see if mbstring is installed and enabled.

This is what I get:
Code: [Select]
mbstring
Multibyte Support enabled
Multibyte string engine libmbfl
Multibyte (japanese) regex support enabled
Multibyte regex (oniguruma) version 4.4.4
Multibyte regex (oniguruma) backtrack check On

mbstring extension makes use of "streamable kanji code filter and converter", which is distributed under the GNU Lesser General Public License version 2.1.

Directive Local Value Master Value
mbstring.detect_order no value no value
mbstring.encoding_translation Off Off
mbstring.func_overload 0 0
mbstring.http_input pass pass
mbstring.http_output pass pass
mbstring.internal_encoding no value no value
mbstring.language neutral neutral
mbstring.strict_detection Off Off
mbstring.substitute_character no value no value

Tide

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Call to undefined function mb_detect_encoding()
« Reply #2 on: April 08, 2009, 03:03:05 PM »
Well it turns out I had two versions of PHP running on my box.  My websites were using an older version and command line was showing the most recent version.  Really strange!  I use a hosting company for my VPS.  They finally noticed the two versions and got it cleaned up.

Thanks for posting back your info.  Without it I doubt I would have been able to show them what was wrong.

 

anything
anything