PHPExcel - Internal Server Error

Hi Folks

i using

i have a problem

get the next error

when run the action "excel"

the code:



require_once 'Classes/PHPExcel.php';

/** PHPExcel_IOFactory */

require_once 'Classes/PHPExcel/IOFactory.php';

class XXXController extends CController


public function actionExcel()


$XLS = new PHPExcel();

$Sheet = $XLS->getActiveSheet();

$Sheet->setCellValue('A1', "File Nr 2");




echo "here OK";

$Writer = new PHPExcel_Writer_Excel5($XLS);

echo "here .....";



when run the "tests" of PHPExcel, work fine, but in Yii not

my guide


That’s a webserver error. Check the error log of your webserver. It should help you to find the problem.

the error is

the problem: PHPExcel_Writer_Excel5.php not exists,

the class is in file Excel5.php

my solution

create PHPExcel_Writer_Excel5.php and put


require_once PHPEXCEL_ROOT . 'PHPExcel/Writer/Excel5.php';


other solution?

If it works, that’s absolutely fine.


Oh, or you could

require_once( PHPEXCEL_ROOT . 'PHPExcel/Writer/Excel5.php'); 

before you use that class.

that’s strange, is already included Excel5.php

but yii gives an error

only work if create PHPExcel_Writer_Excel5.php in the same folder(PHPExcel/Writer)

and put


require_once PHPEXCEL_ROOT . 'PHPExcel/Writer/Excel5.php';



I also use PHPExcel.

I had the same issue, and for me had to do with autoloading conflicts.

I did:



before I started to output the report and after finishing the export put it back to original state:


Hope it helps…

I had the same problem with PHPExcel - now this is a history. "Basva" you are right - this is the right solution. thank you