我想使用phpExcel,但在运行脚本时我收到此错误:
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
我该如何解决?
谢谢
选项1:如果您有权访问php.ini文件,请设置此项mbstring.func_overload = 0
这是Autoloader.php文件中PHPExcel的要求:
... if (ini_get('mbstring.func_overload') & 2) { throw new PHPExcel_Exception('Multibyte function overloading in PHP must be disabled for string functions (2).'); } ...
选项2:如果您没有编辑php.ini的权限,可以在.htaccess文件中设置:
php_value mbstring.func_overload 0