当前位置:Gxlcms > PHP教程 > 【LAMP】Fatalerror:Calltoundefinedfunctionmb_detect_encoding(),该怎么解决

【LAMP】Fatalerror:Calltoundefinedfunctionmb_detect_encoding(),该怎么解决

时间:2021-07-01 10:21:17 帮助过:14人阅读

【LAMP】Fatal error: Call to undefined function mb_detect_encoding()
本帖最后由 default7 于 2014-06-15 14:52:48 编辑

我安装LAMP环境,php-xxx-.tar.gz解压缩后的目录 /home/default7/LAMP/php-5.5.13
PHP安装到的目录 /usr/local/php5
然后我安装之后,打开phpmyadmin,报错提示:


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


命令提示行查看php已经安装的模块:mbstring是存在的
引用
[[email protected] 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]


查看phpinfo,相关几个:

PHP Version 5.5.13
Configure Command
'./configure' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-mysql' '--prefix=/usr/local/php5'

Server API
Apache 2.0 Handler

Virtual Directory Support
enabled

Configuration File (php.ini) Path
/usr/local/php5/lib

Loaded Configuration File
/usr/local/php5/lib/php.ini

Scan 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



查看php5安装后的extension目录(是空的):

[[email protected] ext]# ll /usr/local/php5/lib/php/extensions/no-debug-zts-20121212
total 488
-rwxr-xr-x. 1 root root 495775 Jun 15 01:01 opcache.so
[[email protected] ext]# ll /usr/local/php5/lib/php/extensions
total 4
drwxr-xr-x. 2 root root 4096 Jun 15 01:01 no-debug-zts-20121212


但是在安装后的目录里面另外一个目录却有(目录 /usr/local/php5/include/php/ext):

[[email protected] ext]# pwd
/usr/local/php5/include/php/ext
[[email protected] ext]# ll
total 68
drwxr-xr-x. 3 root root 4096 Jun 15 01:01 date
drwxr-xr-x. 2 root root 4096 Jun 15 01:01 dom
drwxr-xr-x. 3 root root 4096 Jun 15 01:01 ereg
drwxr-xr-x. 2 root root 4096 Jun 15 01:01 filter
drwxr-xr-x. 2 root root 4096 Jun 15 01:01 hash
drwxr-xr-x. 2 root root 4096 Jun 15 01:01 iconv
drwxr-xr-x. 2 root root 4096 Jun 15 01:01 json
drwxr-xr-x. 2 root root 4096 Jun 15 01:01 libxml
drwxr-xr-x. 2 root root 4096 Jun 15 01:02 mysqlnd
drwxr-xr-x. 3 root root 4096 Jun 15 01:01 pcre
drwxr-xr-x. 2 root root 4096 Jun 15 01:02 pdo
drwxr-xr-x. 2 root root 4096 Jun 15 01:01 phar
drwxr-xr-x. 2 root root 4096 Jun 15 01:01 session
drwxr-xr-x. 2 root root 4096 Jun 15 01:01 spl
drwxr-xr-x. 3 root root 4096 Jun 15 01:01 sqlite3
drwxr-xr-x. 2 root root 4096 Jun 15 01:02 standard
drwxr-xr-x. 2 root root 4096 Jun 15 01:02 xml
[[email protected] ext]#




在安装文件夹(/home/default7/LAMP/php-5.5.13/ext)中有mbstring:

[[email protected] ext]# ll
total 328
drwxr-xr-x. 4 1001 1001 4096 May 28 17:06 bcmath
drwxr-xr-x. 3 1001 1001 4096 May 28 17:06 bz2
drwxr-xr-x. 3 1001 1001 4096 May 28 17:06 calendar
drwxr-xr-x. 3 1001 1001 4096 May 28 17:06 com_dotnet
drwxr-xr-x. 4 1001 1001 4096 Jun 15 00:27 ctype
drwxr-xr-x. 3 1001 1001 4096 May 28 17:06 curl
drwxr-xr-x. 5 1001 1001 4096 Jun 15 00:25 date
drwxr-xr-x. 6 1001 1001 4096 May 28 17:06 dba
drwxr-xr-x. 5 1001 1001 4096 Jun 15 00:27 dom
drwxr-xr-x. 4 1001 1001 4096 May 28 17:06 enchant
drwxr-xr-x. 5 1001 1001 4096 Jun 15 00:25 ereg
drwxr-xr-x. 3 1001 1001 4096 May 28 17:06 exif
-rwxr-xr-x. 1 1001 1001 8174 May 28 17:06 ext_skel

人气教程排行