Sheets get copied, php 5.3

Topics: Developer Forum, User Forum
Aug 31, 2011 at 11:43 AM

My script reads an excel worksheet and fills one sheet with data and then it writes it to a new file.

Everything worked fine before moving it to a new server (to PHP 5.3) and now the sheets of the document gets duplicated (twice) with names like 'original sheetname 1' and 'original sheetname 2'. The script also needs more time to generate the file.

Does anyone know what could cause this? In short this is my code (i als input in some cells, but when i just read and write the problem also occurs).

<?php
ini_set('display_errors',1);
set_time_limit (120);
error_reporting(E_ALL);

include 'include/php/PHPExcel.php';
include 'include/php/PHPExcel/Reader/Excel2007.php';
include 'include/php/PHPExcel/Writer/Excel2007.php';
####################
# Read
####################
$objReader = new PHPExcel_Reader_Excel2007();
$objPHPExcel = $objReader->load("sheets/emvi_up_aanbiedend.xlsx");

$objPHPExcel->setActiveSheetIndex(0);




####################
# Write
####################
$mktime = mktime();
$objWriter = new PHPExcel_Writer_Excel2007($objPHPExcel);
$objWriter->save("sheets/emvi_output_" . $mktime . ".xlsx");
header("Location: " . $SITEBASE . "/sheets/emvi_output_" . $mktime . ".xlsx");
?>