Fatal error in Autoloader.php on line 34 phpExcel

别来无恙 提交于 2020-01-01 10:53:11

问题


I want to use phpExcel, but when run the script I get this error:

Fatal error: Uncaught exception 'PHPExcel_Exception' with message 'Multibyte function overloading in PHP must be disabled for string functions (2).' in D:\Apache\htdocs\phpExcel\Classes\PHPExcel\Autoloader.php:34 Stack trace: #0 D:\Apache\htdocs\phpExcel\Classes\PHPExcel.php(32): require() #1 D:\Apache\htdocs\phpExcel\index.php(19): include('D:\Apache\htdoc...') #2 {main} thrown in D:\Apache\htdocs\phpExcel\Classes\PHPExcel\Autoloader.php on line 34

How can I fix it?

Thanks


回答1:


Option 1: If you have access to your php.ini file, set this mbstring.func_overload = 0

It's a requirement of PHPExcel, in their Autoloader.php file:

...
if (ini_get('mbstring.func_overload') & 2) {
    throw new PHPExcel_Exception('Multibyte function overloading in PHP must be disabled for string functions (2).');
}
...

Option 2: If you don't have privileges to edit php.ini, you can setup this in an .htaccess file:

php_value mbstring.func_overload 0


来源:https://stackoverflow.com/questions/20650886/fatal-error-in-autoloader-php-on-line-34-phpexcel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!