问题
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