Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fatal error in Autoloader.php on line 34 phpExcel

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

like image 518
Abduhafiz Avatar asked Dec 18 '13 06:12

Abduhafiz


1 Answers

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
like image 182
Ignacio Ocampo Avatar answered Oct 19 '22 23:10

Ignacio Ocampo