首页

整合php报".. Call to undefined function mb_detect_encoding() .."错误

标签:nginx,php,mb_detect_encoding,异常错误,php_mbstring.dll,extension     发布时间:2015-12-08   

一、异常现象

通过nginx整合php,运行搜索php脚本程序不执行( phpinfo函数能打印),查看nginx目录logs下error.log文件,异常显示“FastCGI sent in stderr: "PHP Fatal error:  Call to undefined function mb_detect_encoding() in D:Users..search.php on line 7",具体如下所示

2015/12/08 15:21:09 [error] 10196#9596: *10 FastCGI sent in stderr: @b@@b@"PHP Fatal error:  Call to undefined function mb_detect_encoding() in .._search.php on line 7" @b@@b@while reading response header from upstream, client: 127.0.0.1, server: localhost, @b@@b@request: "POST /..earch.php?q=tomcat HTTP/1.1", @b@@b@upstream: "fastcgi://127.0.0.1:9000", @b@@b@host: "127.0.0.1",@b@@b@ referrer: "http://127.0.0.1/"

二、解决步骤

1. 到php目录下面找到php.ini文件,打开查找“extension_dir"项,看该配置路径下是否存在php_mbstring.dll文件

2. 再在php.ini查找"extension=php_mbstring.dll",如是";extension=php_mbstring.dll",去除前分号

3.重启服务,问题解决(默认php_mbstring初始化库函数没有初始化)