File Not Found

Topics: Developer Forum, User Forum
May 10, 2011 at 7:23 PM
Edited May 10, 2011 at 7:23 PM

I have a script that looks like this:


require_once 'Classes/PHPExcel.php';

// Create new PHPExcel object
$objPHPExcel = new PHPExcel();

// Set properties
							 ->setTitle("Computerinfo Export")
							 ->setSubject("Computerinfo Export")
							 ->setDescription("Computerinfo Export")
							 ->setKeywords("Computer Info Computerinfo Export Illution")

$Arr = array(array("Type" => "B�rbar","Computermodel" => "HP Ting", "Computernavn" => "Lafh2312412"));
// Add some data
            ->setCellValue('A1', 'Type')
			->setCellValue('B1', 'Computermodel')
			->setCellValue('C1', 'Computernavn');
			->setCellValue('A2', 'B�rbar')
            ->setCellValue('B2', 'HP Ting')
            ->setCellValue('C2', 'Lafh1234354');
foreach ($Arr as $Number => $SubArr)
	$Charnum = 0;
	foreach ($SubArr as $Name => $Value)
		$Cell = $CharsArr[$Charnum];
		$Cell .= $Number+2;
		$objPHPExcel->setActiveSheetIndex(0)->setCellValue($Cell, $Value);	
	array('fill' 	=> array(
								'type'		=> PHPExcel_Style_Fill::FILL_SOLID,
								'color'		=> array('argb' => '0000FF00')
// Rename sheet

// Set active sheet index to the first sheet, so Excel opens this as the first sheet
// Save Excel 2007 file
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objWriter->save(str_replace('.php', '.xlsx', __FILE__));

// Redirect output to a client's web browser (Excel5)
header('Content-Type: application/');
header('Content-Disposition: attachment;filename="Export.xlsx"');
header('Cache-Control: max-age=0');

$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');

When i runs on my linux server the browser just says "File not fould".

I know the file exists, and when i remove the line


is "works", but it doesnt output anything.

I tested it on a Windows machine at it worked fine.

My linux server also has Gzib Compression, has it something with that to do?

May 10, 2011 at 7:31 PM
Edited May 10, 2011 at 7:46 PM

I have the following parameter in the "Configure Command" "--with-zip" is that good enough?

Also i found out that i can make "Excel5" files, but can't make "Excel2007" files.

I have php version "5.2.17"

May 10, 2011 at 8:13 PM

If ZipArchive isn't enabled, then you can enable the built-in PCLZip wrapper using


before instantiating your Writer.

This currently only works with the Excel2007 Writer, and you should download the latest SVN version of the code.

May 10, 2011 at 8:25 PM

THAAAAAAAAAAAAAAANK YOU!!!!!! You saved my *day* :D :D :D