Undefined method setTempDir

Topics: User Forum
Jun 23, 2008 at 2:41 AM
Edited Jun 23, 2008 at 9:22 AM

Hi,

I use PHPExcel 1.6.1 and I get following errors:

[code]Warning: tempnam() [function.tempnam]: open_basedir restriction in effect. File() is not within the allowed path(s): (/home) in /home/c/o/l/coldpeer/www/trash/PHPExcel/Shared/OLE/OLE_File.php on line 87

Fatal error: Uncaught exception 'Exception' with message 'Can't create temporary file' in /home/c/o/l/coldpeer/www/trash/PHPExcel/Shared/OLE/OLE_File.php:90 Stack trace: #0 /home/c/o/l/coldpeer/www/trash/PHPExcel/Writer/Excel5/Workbook.php(580): PHPExcel_Shared_OLE_PPS_File->init() #1 /home/c/o/l/coldpeer/www/trash/PHPExcel/Writer/Excel5/Workbook.php(548): PHPExcel_Writer_Excel5_Workbook->_storeOLEFile() #2 /home/c/o/l/coldpeer/www/trash/PHPExcel/Writer/Excel5/Workbook.php(225): PHPExcel_Writer_Excel5_Workbook->_storeWorkbook() #3 /home/c/o/l/coldpeer/www/trash/PHPExcel/Writer/Excel5.php(322): PHPExcel_Writer_Excel5_Workbook->close() #4 /home/c/o/l/coldpeer/www/trash/allegro.php(194): PHPExcel_Writer_Excel5->save('excel_download....') #5 {main} thrown in /home/c/o/l/coldpeer/www/trash/PHPExcel/Shared/OLE/OLE_File.php on line 90[/code]

I found to fix it I should use

$objPHPExcel->setTempDir($_SERVER['DOCUMENT_ROOT']);

...Unfortunately, that function does not exist.

Fatal error: Call to undefined method PHPExcel::setTempDir() in /home/c/o/l/.../index.php on line 166

Any ideas? Thanks in advance.

Coordinator
Jun 23, 2008 at 7:13 AM
Try that same method on the writer object ($objWriter->setTempDir)
Jun 23, 2008 at 9:22 AM
Oh, right. Thanks