Generating Excel Files give a PHP error

Topics: User Forum
Apr 25, 2014 at 10:44 PM
Hi, I have this error when I try to generate a Excel File.

2014/04/25 12:50:08 [error] [php] realpath() [<a href='function.realpath'>function.realpath</a>]: SAFE MODE Restriction in effect. The script whose uid is 1257 is not allowed to access /tmp owned by uid 0 (/home2/ceianeco/public_html/sga_v2/protected/extensions/phpexcel/Classes/PHPExcel/Shared/File.php:136)
Stack trace:

0 /home2/ceianeco/public_html/sga_v2/protected/extensions/phpexcel/Classes/PHPExcel/Writer/Excel5.php(183): PHPExcel_Shared_OLE_PPS_Root->__construct()

1 /home2/ceianeco/public_html/sga_v2/protected/components/EExcelView.php(145): PHPExcel_Writer_Excel5->save()

... more lines ....


I know is an PHP server side config option, because of the "SAFE MODE Restriction".
But there is any way from PHPExcel to make a tmp file in another location ?

Best Regards
Coordinator
Apr 25, 2014 at 11:31 PM
Use upload-directory when defined to allow running on environments having very restricted open_basedir configs
PHPExcel_Shared_File::setUseUploadTempDirectory(true);
Marked as answer by Nicolas400 on 4/26/2014 at 1:57 PM
Apr 26, 2014 at 9:54 PM
Well, Thanks Mark!.
I added that line and changed some permission on the "/tmp" folder ... sudenly it works.
what is strange to me is that PHPExcel_Shared_Filedoesn't have the method setUseUploadTempDirectory ....

But it work for now!