环境:CentOS 6.5 64bit
PHP版本:5.3.3
【问题】
搭建stalker server,登陆管理页面后进入IPTV channels/Channels:http://10.209.177.82/stalker_portal/server/adm/tv-channels/iptv-list 出现错误:HTTP ERROR 500
从/etc/httpd/logs/stalker-error_log看到错误信息:
PHP Fatal error: Call to undefined function Controller\\mb_strtoupper() in /var/www/html/stalker_portal/admin/src/Controller/BaseStalkerController.php on line 589, referer: http://10.209.177.82/stalker_portal/server/adm/
【解决方法】
1.检查php_mbstring是不是这个扩展没有安装或打开。
检查方式:
php -m
或者从phpinfo
<?php
phpinfo();
?>
确认没有安装php_mbstring这个扩展。
2.安装php_mbstring这个扩展。
[root@localhost Controller]# yum list | grep mbstring
php-mbstring.x86_64 5.3.3-49.el6 base
[root@localhost Controller]# yum install php-mbstring
安装成功。
从下面目录看到已有mbstring.ini
[root@localhost Controller]# ll /etc/php.d/
total 76
-rw-r--r-- 1 root root 49 Mar 22 2017 curl.ini
-rw-r--r-- 1 root root 57 Mar 22 2017 fileinfo.ini
-rw-r--r-- 1 root root 90 Jan 23 17:54 geoip.ini
-rw-r--r-- 1 root root 55 Jan 23 11:01 imagick.ini
-rw-r--r-- 1 root root 49 Mar 22 2017 intl.ini
-rw-r--r-- 1 root root 49 Mar 22 2017 json.ini
-rw-r--r-- 1 root root 57 Mar 22 2017 mbstring.ini
-rw-r--r-- 1 root root 53 Jan 18 13:47 mcrypt.ini
-rw-r--r-- 1 root root 1329 Jun 22 2012 memcache.ini
-rw-r--r-- 1 root root 53 Mar 22 2017 mysqli.ini
-rw-r--r-- 1 root root 51 Mar 22 2017 mysql.ini
-rw-r--r-- 1 root root 47 Mar 22 2017 pdo.ini
-rw-r--r-- 1 root root 59 Mar 22 2017 pdo_mysql.ini
-rw-r--r-- 1 root root 61 Mar 22 2017 pdo_sqlite.ini
-rw-r--r-- 1 root root 49 Mar 22 2017 phar.ini
-rw-r--r-- 1 root root 49 Mar 22 2017 soap.ini
-rw-r--r-- 1 root root 55 Mar 22 2017 sqlite3.ini
-rw-r--r-- 1 root root 49 Mar 22 2017 tidy.ini
-rw-r--r-- 1 root root 47 Mar 22 2017 zip.ini
[root@localhost Controller]# cat /etc/php.d/mbstring.ini
; Enable mbstring extension module
extension=mbstring.so
重启Apache
[root@localhost Controller]# service httpd restart
3.检测是否安装成功
在网站目录下新建一个phpinfo.php测试页面,写上下面代码,保存。
- <?php
- phpinfo();
- ?>
之后再测试:登陆管理页面后进入IPTV channels/Channels:http://localhost/stalker_portal/server/adm/tv-channels/iptv-list 成功。