[LAMP] Fatalerror: Calltoundefinedfunctionmb_detect_encoding ()

Source: Internet
Author: User
Tags zts
[LAMP] Fatalerror: Calltoundefinedfunctionmb_detect_encoding () I installed the lampenvironment, php-xxx-.tar.gz decompressed directory/home/default7/LAMP/php-5.5.13
PHP installation directory/usr/local/php5
After installation, open phpmyadmin and report the following error:

Fatal error: Call to undefined function mb_detect_encoding() in /usr/local/apache2/htdocs/phpmyadmin/libraries/php-gettext/gettext.inc on line 177


Run the command to view the installed php modules: Mbstring exists..

[Root @ localhost php-5.5.13] # php-m
[PHP Modules]
Bz2
Calendar
Core
Ctype
Curl
Date
Ereg
Exif
Fileinfo
Filter
Ftp
Gettext
Gmp
Hash
Iconv
Json
Libxml
Mbstring
Openssl
Pcntl
Pcre
Phar
Readline
Reflection
Session
Shmop
SimpleXML
Sockets
SPL
Standard
Tokenizer
Xml
Zip
Zlib

[Zend Modules]



Check the phpinfo file. The following table lists the related information:
PHP Version 5.5.13Configure Command './configure' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-mysql' '--prefix=/usr/local/php5' Server API Apache 2.0 HandlerVirtual Directory Support enabledConfiguration File (php.ini) Path /usr/local/php5/libLoaded Configuration File /usr/local/php5/lib/php.iniScan this dir for additional .ini files (none)Additional .ini files parsed (none) extension_dir/usr/local/php5/lib/php/extensions/no-debug-zts-20121212/usr/local/php5/lib/php/extensions/no-debug-zts-20121212


View the extension directory (empty) after php5 installation ):
[root@localhost ext]# ll /usr/local/php5/lib/php/extensions/no-debug-zts-20121212total 488-rwxr-xr-x. 1 root root 495775 Jun 15 01:01 opcache.so[root@localhost ext]# ll /usr/local/php5/lib/php/extensionstotal 4drwxr-xr-x. 2 root root 4096 Jun 15 01:01 no-debug-zts-20121212


However, there is another directory in the installed Directory (directory/usr/local/php5/include/php/ext ):
[root@localhost ext]# pwd/usr/local/php5/include/php/ext[root@localhost ext]# lltotal 68drwxr-xr-x. 3 root root 4096 Jun 15 01:01 datedrwxr-xr-x. 2 root root 4096 Jun 15 01:01 domdrwxr-xr-x. 3 root root 4096 Jun 15 01:01 eregdrwxr-xr-x. 2 root root 4096 Jun 15 01:01 filterdrwxr-xr-x. 2 root root 4096 Jun 15 01:01 hashdrwxr-xr-x. 2 root root 4096 Jun 15 01:01 iconvdrwxr-xr-x. 2 root root 4096 Jun 15 01:01 jsondrwxr-xr-x. 2 root root 4096 Jun 15 01:01 libxmldrwxr-xr-x. 2 root root 4096 Jun 15 01:02 mysqlnddrwxr-xr-x. 3 root root 4096 Jun 15 01:01 pcredrwxr-xr-x. 2 root root 4096 Jun 15 01:02 pdodrwxr-xr-x. 2 root root 4096 Jun 15 01:01 phardrwxr-xr-x. 2 root root 4096 Jun 15 01:01 sessiondrwxr-xr-x. 2 root root 4096 Jun 15 01:01 spldrwxr-xr-x. 3 root root 4096 Jun 15 01:01 sqlite3drwxr-xr-x. 2 root root 4096 Jun 15 01:02 standarddrwxr-xr-x. 2 root root 4096 Jun 15 01:02 xml[root@localhost ext]# 



There is mbstring in the installation folder (/home/default7/LAMP/php-5.5.13/ext:
[root@localhost ext]# lltotal 328drwxr-xr-x.  4 1001 1001  4096 May 28 17:06 bcmathdrwxr-xr-x.  3 1001 1001  4096 May 28 17:06 bz2drwxr-xr-x.  3 1001 1001  4096 May 28 17:06 calendardrwxr-xr-x.  3 1001 1001  4096 May 28 17:06 com_dotnetdrwxr-xr-x.  4 1001 1001  4096 Jun 15 00:27 ctypedrwxr-xr-x.  3 1001 1001  4096 May 28 17:06 curldrwxr-xr-x.  5 1001 1001  4096 Jun 15 00:25 datedrwxr-xr-x.  6 1001 1001  4096 May 28 17:06 dbadrwxr-xr-x.  5 1001 1001  4096 Jun 15 00:27 domdrwxr-xr-x.  4 1001 1001  4096 May 28 17:06 enchantdrwxr-xr-x.  5 1001 1001  4096 Jun 15 00:25 eregdrwxr-xr-x.  3 1001 1001  4096 May 28 17:06 exif-rwxr-xr-x.  1 1001 1001  8174 May 28 17:06 ext_skel-rw-r--r--.  1 1001 1001  1524 May 28 17:06 ext_skel_win32.phpdrwxr-xr-x.  5 1001 1001  4096 Jun 15 00:27 fileinfodrwxr-xr-x.  5 1001 1001  4096 Jun 15 00:28 filterdrwxr-xr-x.  3 1001 1001  4096 May 28 17:06 ftpdrwxr-xr-x.  4 1001 1001  4096 May 28 17:06 gddrwxr-xr-x.  3 1001 1001  4096 May 28 17:06 gettextdrwxr-xr-x.  3 1001 1001  4096 May 28 17:06 gmpdrwxr-xr-x.  4 1001 1001  4096 Jun 15 00:43 hashdrwxr-xr-x.  4 1001 1001  4096 Jun 15 00:28 iconvdrwxr-xr-x.  3 1001 1001  4096 May 28 17:06 imapdrwxr-xr-x.  3 1001 1001  4096 May 28 17:06 interbasedrwxr-xr-x. 20 1001 1001  4096 May 28 17:06 intldrwxr-xr-x.  4 1001 1001  4096 Jun 15 00:28 jsondrwxr-xr-x.  3 1001 1001  4096 May 28 17:06 ldapdrwxr-xr-x.  4 1001 1001  4096 Jun 15 00:26 libxmldrwxr-xr-x.  6 1001 1001  4096 May 28 17:06 mbstringdrwxr-xr-x.  3 1001 1001  4096 May 28 17:06 mcryptdrwxr-xr-x.  2 1001 1001  4096 May 28 17:06 mssqldrwxr-xr-x.  4 1001 1001  4096 Jun 15 00:28 mysqldrwxr-xr-x.  3 1001 1001  4096 May 28 17:06 mysqlidrwxr-xr-x.  3 1001 1001  4096 Jun 15 00:32 mysqlnddrwxr-xr-x.  3 1001 1001  4096 May 28 17:06 oci8drwxr-xr-x.  3 1001 1001  4096 May 28 17:06 odbcdrwxr-xr-x.  5 1001 1001  4096 Jun 15 00:35 opcachedrwxr-xr-x.  3 1001 1001  4096 May 28 17:06 openssldrwxr-xr-x.  3 1001 1001  4096 May 28 17:06 pcntldrwxr-xr-x.  5 1001 1001  4096 Jun 15 00:26 pcredrwxr-xr-x.  4 1001 1001  4096 Jun 15 00:28 pdodrwxr-xr-x.  3 1001 1001  4096 May 28 17:06 pdo_dblibdrwxr-xr-x.  3 1001 1001  4096 May 28 17:06 pdo_firebirddrwxr-xr-x.  3 1001 1001  4096 May 28 17:06 pdo_mysqldrwxr-xr-x.  3 1001 1001  4096 May 28 17:06 pdo_ocidrwxr-xr-x.  3 1001 1001  4096 May 28 17:06 pdo_odbcdrwxr-xr-x.  3 1001 1001  4096 May 28 17:06 pdo_pgsqldrwxr-xr-x.  4 1001 1001  4096 Jun 15 00:29 pdo_sqlitedrwxr-xr-x.  3 1001 1001  4096 May 28 17:06 pgsqldrwxr-xr-x.  5 1001 1001  4096 Jun 15 01:41 phardrwxr-xr-x.  4 1001 1001  4096 Jun 15 00:29 posixdrwxr-xr-x.  3 1001 1001  4096 May 28 17:06 pspelldrwxr-xr-x.  3 1001 1001  4096 May 28 17:06 readlinedrwxr-xr-x.  2 1001 1001  4096 May 28 17:06 recodedrwxr-xr-x.  4 1001 1001  4096 Jun 15 00:29 reflectiondrwxr-xr-x.  4 1001 1001  4096 Jun 15 00:29 sessiondrwxr-xr-x.  3 1001 1001  4096 May 28 17:06 shmopdrwxr-xr-x.  5 1001 1001  4096 Jun 15 00:29 simplexmldrwxr-xr-x.  3 1001 1001  4096 May 28 17:06 skeletondrwxr-xr-x.  3 1001 1001  4096 May 28 17:06 snmpdrwxr-xr-x.  4 1001 1001  4096 May 28 17:06 soapdrwxr-xr-x.  3 1001 1001  4096 May 28 17:06 socketsdrwxr-xr-x.  6 1001 1001  4096 Jun 15 00:29 spldrwxr-xr-x.  5 1001 1001  4096 Jun 15 00:26 sqlite3drwxr-xr-x.  5 1001 1001 12288 Jun 15 01:41 standarddrwxr-xr-x.  3 1001 1001  4096 May 28 17:06 sybase_ctdrwxr-xr-x.  3 1001 1001  4096 May 28 17:06 sysvmsgdrwxr-xr-x.  3 1001 1001  4096 May 28 17:06 sysvsemdrwxr-xr-x.  3 1001 1001  4096 May 28 17:06 sysvshmdrwxr-xr-x.  4 1001 1001  4096 May 28 17:06 tidydrwxr-xr-x.  4 1001 1001  4096 Jun 15 00:31 tokenizerdrwxr-xr-x.  3 1001 1001  4096 May 28 17:06 wddxdrwxr-xr-x.  4 1001 1001  4096 Jun 15 00:31 xmldrwxr-xr-x.  5 1001 1001  4096 Jun 15 00:31 xmlreaderdrwxr-xr-x.  4 1001 1001  4096 May 28 17:06 xmlrpcdrwxr-xr-x.  5 1001 1001  4096 Jun 15 00:31 xmlwriterdrwxr-xr-x.  3 1001 1001  4096 May 28 17:06 xsldrwxr-xr-x.  5 1001 1001  4096 May 28 17:06 zipdrwxr-xr-x.  3 1001 1001  4096 May 28 17:06 zlib


In php. ini, all extension_dir objects are commented out, but mysql pdo is displayed in phpinfo.



Reply to discussion (solution)

Print_r (get_extension_funcs ('mbstring '));
Check which functions are available.

Print_r (get_extension_funcs ('mbstring '));
Check which functions are available.



Null.

It is not loaded!
If it is loaded, it should be displayed

Array(    [0] => mb_convert_case    [1] => mb_strtoupper    [2] => mb_strtolower    [3] => mb_language    [4] => mb_internal_encoding    [5] => mb_http_input    [6] => mb_http_output    [7] => mb_detect_order    [8] => mb_substitute_character    [9] => mb_parse_str    [10] => mb_output_handler    [11] => mb_preferred_mime_name    [12] => mb_strlen    [13] => mb_strpos    [14] => mb_strrpos    [15] => mb_stripos    [16] => mb_strripos    [17] => mb_strstr    [18] => mb_strrchr    [19] => mb_stristr    [20] => mb_strrichr    [21] => mb_substr_count    [22] => mb_substr    [23] => mb_strcut    [24] => mb_strwidth    [25] => mb_strimwidth    [26] => mb_convert_encoding    [27] => mb_detect_encoding    [28] => mb_list_encodings    [29] => mb_encoding_aliases    [30] => mb_convert_kana    [31] => mb_encode_mimeheader    [32] => mb_decode_mimeheader    [33] => mb_convert_variables    [34] => mb_encode_numericentity    [35] => mb_decode_numericentity    [36] => mb_send_mail    [37] => mb_get_info    [38] => mb_check_encoding    [39] => mb_regex_encoding    [40] => mb_regex_set_options    [41] => mb_ereg    [42] => mb_eregi    [43] => mb_ereg_replace    [44] => mb_eregi_replace    [45] => mb_ereg_replace_callback    [46] => mb_split    [47] => mb_ereg_match    [48] => mb_ereg_search    [49] => mb_ereg_search_pos    [50] => mb_ereg_search_regs    [51] => mb_ereg_search_init    [52] => mb_ereg_search_getregs    [53] => mb_ereg_search_getpos    [54] => mb_ereg_search_setpos    [55] => mbregex_encoding    [56] => mbereg    [57] => mberegi    [58] => mbereg_replace    [59] => mberegi_replace    [60] => mbsplit    [61] => mbereg_match    [62] => mbereg_search    [63] => mbereg_search_pos    [64] => mbereg_search_regs    [65] => mbereg_search_init    [66] => mbereg_search_getregs    [67] => mbereg_search_getpos    [68] => mbereg_search_setpos)

It is not loaded!
If it is loaded, it should be displayed



Install unzip on/home/default7/LAMP/php-5.5.13
Prepare to install it in the/usr/local/php5 Directory

One of my questions is about linux./configure:
If I first decompress the directory./configure -- prefix =... & make test & make install ...... Installed.
1) so I need to add new extensions. is it still in this extract directory to./configure -- prefix =... & make install to re-compile?
2) If this is the case, I will not extract the folder for the first time./configure and check whether all the parameters must be included (whether this directory has the memory function)

I have never done it.
There are many tutorials on the Internet.

I have never done it.
There are many tutorials on the Internet.



Later, you can install it again./configure.
But make clean first. after decompression, the directory of./configure will remember the installation process.
After the -- enable-mbstring is reinstalled. I have reinstalled it several times before, but I didn't make clean. This may be the reason.

Make clean
./Configure -- prefix =/usr/local/php5
Make
Make test
Make install

Phpinfo ();
?>
Check whether there is any mbstring. if not, check php. ini.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.