微信浏览器打开出现
Fatal error: Uncaught thinkexceptionErrorException: Undefined offset: 1 in /www/wwwroot/sd.cn/application/common/view/tpl/think_exception.tpl:22 Stack trace: #0 /www/wwwroot/sd.cn/application/common/view/tpl/think_exception.tpl(22): thinkError::appError(8, ‘Undefined offse…’, ‘/www/wwwroot/sd…’, 22, Array) #1 /www/wwwroot/sd.cn/thinkphp/library/think/exception/Handle.php(178): include(‘/www/wwwroot/sd…’) #2 /www/wwwroot/sd.cn/thinkphp/library/think/exception/Handle.php(96): thinkexceptionHandle->convertExceptionToResponse(Object(thinkexceptionErrorException)) #3 /www/wwwroot/sd.cn/thinkphp/library/think/Error.php(52): thinkexceptionHandle->render(Object(thinkexceptionErrorException)) #4 /www/wwwroot/sd.cn/thinkphp/library/think/Error.php(88): thinkError::appException(Object(thinkexceptionErrorException)) #5 [internal function]: thinkError::appShutdown() #6 {main} thrown in /www/wwwroot/sd.cn/application/common/view/tpl/think_exception.tpl on line 22
解决办法:
1、
application/common/view/tpl/think_exception.tpl
修改为:$langSet= strtolower(isset($matches[1])?$matches[1]:'');
thinkphp/library/think/Lang.php
修改为:$langSet = strtolower(isset($matches[1])?$matches[1]:'');
2、第二种方法不需要多语言的话关闭配置信息
关闭多语言
application/config.php
修改为:'lang_switch_on' => false