Export to Excel - unlink: Permission denied

(5 posts) (2 voices)


  1. ziuras, Member

    When i want export report to Excel i get file (name.xlsx) with text error inside:

    Warning: unlink(C:\Inetpub\wwwroot\php7.tmp): Permission denied in C:\Inetpub\wwwroot\lib\external\phpExcel\PHPExcel\Writer\Excel2007.php on line 228

    Fatal error: Uncaught exception 'Exception' with message 'Could not close zip file C:\Inetpub\wwwroot\php7.tmp.' in C:\Inetpub\wwwroot\lib\external\phpExcel\PHPExcel\Writer\Excel2007.php:346
    Stack trace:
    #0 C:\Inetpub\wwwroot\lib\export.php(2158): PHPExcel_Writer_Excel2007->save()
    #1 C:\Inetpub\wwwroot\apps\showReport.php(5229): mydbrExport->print_report()
    #2 C:\Inetpub\wwwroot\report.php(357): unknown()
    #3 {main}
    thrown in C:\Inetpub\wwwroot\lib\external\phpExcel\PHPExcel\Writer\Excel2007.php on line 346

    permisions on wwwroot directory an exactly on this file (php7.tmp) is full access for everyone and does not have flag readOnly.

    Can someone help me?

    Posted 5 years ago #
  2. myDBR Team, Key Master

    Check first that your web server has write access to the directory in question.

    myDBR Team

    Posted 5 years ago #
  3. ziuras, Member

    i add everyone fullcontrol to wwwroot.
    after export command i found 3 files in wwwroot\:
    php1.tmp -> with error described in first post
    php1.tmp.a01420 -> correct excel file
    php1.tmp.b01420 -> correct excel file

    and these files are populated after each export
    php2.tmp*, php3.tmp*, and so on

    Posted 5 years ago #
  4. myDBR Team, Key Master

    While PHPExcel (underlying PHP library for handling Excel file generation) in myDBR uses temporary files when it generates the Excel file to be downloaded, it should not leave these temporary files in place. Failing to do so, would implicate a permission problem.

    You could also check if you have temporary directory defined in your web server installation.

    myDBR Team

    Posted 5 years ago #
  5. ziuras, Member

    did not resolve this problem.
    reinstall mydbr on ubuntu 12.04 and the problem disapear :)

    old instalation was on windows server 2003 64b R2.

    Posted 5 years ago #


You must log in to post.