致命错误:调用未定义的函数mb_strpos()

时间:2013-08-03 18:20:01

标签: php joomla fatal-error mbstring

我遇到了这个问题,我似乎无法找到解决方案。

服务器中安装的PHP版本是5.3.22。安装Joomla和默认样本数据后,我在访问该网站时遇到此错误:

Fatal error: Call to undefined function mb_strpos() in /public_html/site/templates/yoo_sync/layouts/module.php on line 115

我检查了phpinfo页面,我发现缺少选项--enable-mbstring

before adding the handler

我与托管公司的支持团队进行了交谈,他们告诉我将以下条目添加到Joomla安装目录中的.htaccess文件中:

AddHandler application/x-httpd-php55 .php

现在我可以看到那里的选项,但很多其他选项都丢失了:

after adding the handler

会导致以下错误(由于缺少选项):

Database connection error (1): The MySQL adapter 'mysqli' is not available.

还有什么我可以尝试的吗?

3 个答案:

答案 0 :(得分:3)

只需将代码切换为JString:strpos()即可。 Joomla不要求你安装了mb。

答案 1 :(得分:2)

在Windows安装(也可能是其他安装)上,默认情况下不加载php_mbstring.dll。在php.ini中取消注释 这对我有用。

答案 2 :(得分:1)

通过将AddHandler application/x-httpd-php55 .php添加到根级别的.htaccess(〜/ public_html)来修复此问题