Not sure what to do here...

Topics: User Forum
Nov 16, 2007 at 9:42 PM
Installed PHPExcel to /home/crnorth/public_html/new_site/PHPExcel.
Modified 05featuredemo.php to save as Excel5 .vs Excel2007. Works great when run on my dev machine.
Got this trying to run http://www.crnorthampton.com/new_site/PHPExcel/Tests/05featuredemo.php

Warning: tempnam(): open_basedir restriction in effect.
File() is not within the allowed path(s): (/home/crnorth:/usr/lib/php:/usr/local/lib/php:/tmp)
in /home/crnorth/public_html/new_site/PHPExcel/Classes/PHPExcel/Shared/OLE/OLE_File.php
on line 87

Fatal error: Uncaught exception 'Exception' with message 'Can't create temporary file'
in /home/crnorth/public_html/new_site/PHPExcel/Classes/PHPExcel/Shared/OLE/OLE_File.php:90

Stack trace:
#0 /home/crnorth/public_html/new_site/PHPExcel/Classes/PHPExcel/Writer/Excel5/Workbook.php(573): PHPExcel_Shared_OLE_PPS_File->init()
#1 /home/crnorth/public_html/new_site/PHPExcel/Classes/PHPExcel/Writer/Excel5/Workbook.php(541): PHPExcel_Writer_Excel5_Workbook->_storeOLEFile()
#2 /home/crnorth/public_html/new_site/PHPExcel/Classes/PHPExcel/Writer/Excel5/Workbook.php(225): PHPExcel_Writer_Excel5_Workbook->_storeWorkbook()
#3 /home/crnorth/public_html/new_site/PHPExcel/Classes/PHPExcel/Writer/Excel5.php(240): PHPExcel_Writer_Excel5_Workbook->close()
#4 /home/crnorth/public_html/new_site/PHPExcel/Tests/05featuredemo.php(38): PHPExcel_Writer_Excel5->save('php://output')
#5 {main}
thrown in /home/crnorth/public_html/new_site/PHPExcel/Classes/PHPExcel/Shared/OLE/OLE_File.php on line 90
Coordinator
Nov 19, 2007 at 8:16 AM
Please check your PHP configuration for safe mode and open_basedir restrictions.
Nov 19, 2007 at 12:20 PM
open_basedir = /home/crnorth:/usr/lib/php:/usr/local/lib/php:/tmp

So,shouldn't I be able to create a file in /tmp?
Coordinator
Nov 19, 2007 at 5:45 PM
Check Excel5 writer's setTempDir() method, this is introduced to specify an alternative temp location. I guess this should solve your problem.