A l’hora d’instal·lar aquest package és molt possible que no generi l’Excel tot i que en el nostre servidor de proves funcioni correctament. Per solucionar-ho he trobat una solució que sembla que funciona correctament.
// Buscar a l'arxiu vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/File.php la línia 150 i sustituir per el següent (és afegir un else i comentar el return final
if ( !function_exists('sys_get_temp_dir')) {
if ($temp = getenv('TMP') ) {
if ((!empty($temp)) && (file_exists($temp))) { return realpath($temp); }
}
if ($temp = getenv('TEMP') ) {
if ((!empty($temp)) && (file_exists($temp))) { return realpath($temp); }
}
if ($temp = getenv('TMPDIR') ) {
if ((!empty($temp)) && (file_exists($temp))) { return realpath($temp); }
}
// trick for creating a file in system's temporary dir
// without knowing the path of the system's temporary dir
$temp = tempnam(__FILE__, '');
if (file_exists($temp)) {
unlink($temp);
return realpath(dirname($temp));
}
return null;
}else{
return getcwd();
}
// use ordinary built-in PHP function
//There should be no problem with the 5.2.4 Suhosin realpath() bug, because this line should only
//be called if we're running 5.2.1 or earlier
//return realpath(sys_get_temp_dir());

