Linux-centos7 under the PHP7 mbstring extension does not load properly, how to solve? --has been resolved,

Source: Internet
Author: User
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配置文件不一致。

  • 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.