Call to undefined method PHPExcel_Writer_Excel5::setTempDir()

Feb 12, 2008 at 1:34 PM
Since moving server I am having trouble creating using Excel5.

I have placed the test sheet at the following address but it displays an error starting with "Fatal error: Uncaught exception 'Exception' with message 'Can't create temporary file' in D:\Inetpub\vhosts\\httpdocs\Excel\PHPExcel\Shared\OLE\OLE_File.php:90 Stack trace: #0"

I have then tried using setTempDir as per View.aspx?ThreadId=17955 but it then displays "Fatal error: Call to undefined method PHPExcelWriterExcel5::setTempDir() in D:\Inetpub\vhosts\\httpdocs\Excel\index.php on line 56"

Does anyone know of this problem or if I have old files etc.

Feb 12, 2008 at 3:04 PM
Are you sure the directory passed to setTempDir() is writable? Looking at seems like this is not the case.
Feb 12, 2008 at 4:33 PM
Hi maartenba, the directory is writable.

I have these lines in my script...

$objWriter = new PHPExcelWriterExcel5($objPHPExcel);

...and the 'call to undefined method' error mentioned earlier appears?!?

Feb 12, 2008 at 5:23 PM
What version of PHPExcel are you using?
Feb 12, 2008 at 11:11 PM
Version 5.2.5
Feb 13, 2008 at 12:56 AM
I'm still not quite sure what was causing my problem on my new server but I managed to get around it by changing line 87 of OLE_FILE.php found in the Shared\OLE folder.

I replaced $this->tmpdir with 'test' and the error went away & the file was created as normal in the test folder.
Feb 13, 2008 at 8:52 AM
Will check this and fix if possible.
Feb 18, 2008 at 12:13 PM
the path you set for tmpDir ist not valid...

if you use double quote, you have to escape the \ character with \\ (or better use single quotes).


.. should work