1, Problem: PHP mbstring extension cannot be loaded properly.
2, Environment: centos7.2 virtual machine, PHP Version = 7.0.8
My PHP is installed through Yum, the installation source is webstatic, the mbstring extension is also used in this source, version is also true.
View/etc/php.d/mbstring.ini The extension is open, and/lib64/php/modules/mbstring.so is also present.
But call the Mb_strlen () function times wrong:
3, Code and errors
1
PHP Fatal error: Uncaught Error: Call to undefined function mb_strlen() in /var/www/php-test/mb-encoding/mb-strlen.php:2 349 Stack trace: 350 #0 {main} 351 thrown in /var/www/php-test/mb-encoding/mb-strlen.php on line 2
4,补充:
php -m中是有的
> php -m | grep mbstringmbstring
但php -info中没有
5,已解决:
之前有人问过这个问题:https://segmentfault.com/q/10...
Reply content:
1, Problem: PHP mbstring extension cannot be loaded properly.
2, Environment: centos7.2 virtual machine, PHP Version = 7.0.8
My PHP is installed through Yum, the installation source is webstatic, the mbstring extension is also used in this source, version is also true.
View/etc/php.d/mbstring.ini The extension is open, and/lib64/php/modules/mbstring.so is also present.
But call the Mb_strlen () function times wrong:
3, Code and errors
1
PHP Fatal error: Uncaught Error: Call to undefined function mb_strlen() in /var/www/php-test/mb-encoding/mb-strlen.php:2 349 Stack trace: 350 #0 {main} 351 thrown in /var/www/php-test/mb-encoding/mb-strlen.php on line 2
4,补充:
php -m中是有的
> php -m | grep mbstringmbstring
但php -info中没有
5,已解决:
之前有人问过这个问题:https://segmentfault.com/q/10...
php -m | grep mbstring
这个在就在,不在就不在了
不在的话要重新下载mbstring源码,编译安装
上面是题主修改之前的答案。。
ini里面没有加载扩展, php -m 里面会有?
php-cli和php-cgi是同一个版本的php?
不会是本机有两个版本的php..
之前有人问过这个问题,可以参考这个提问,https://segmentfault.com/q/10...。
主要原因是安装扩展后,php-fpm(FastCGI Process Manager:FastCGI进程管理器)没有重启,导致cgi和cli加载的php配置文件不一致。