php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72818 PHP warning: ZipArchive::close(): Renaming temporary file failed: No such file
Submitted: 2016-08-12 03:02 UTC Modified: 2016-08-12 11:52 UTC
Votes:18
Avg. Score:4.1 ± 1.1
Reproduced:14 of 16 (87.5%)
Same Version:2 (14.3%)
Same OS:5 (35.7%)
From: starrychloe at oliveyou dot net Assigned:
Status: Open Package: Zip Related
PHP Version: 5.6.24 OS: Cygwin
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2016-08-12 03:02 UTC] starrychloe at oliveyou dot net
Description:
------------
Cannot create a zip file. 

PHP warning:  ZipArchive::close(): Renaming temporary file failed: No such file or directory

No search results.

https://duckduckgo.com/?q=PHP+warning%3A+ZipArchive%3A%3Aclose()%3A+%22Renaming+temporary+file+failed%3A+No+such+file+or+directory%22&ia=web

http://stackoverflow.com/questions/38886193/php-ziparchiveclose-renaming-temporary-file-failed-no-such-file-or-direct

Cygwin 2.5.2
Windows 8.1.
PHP 5.6.24 (cli) (built: Jul 22 2016 03:53:28)


Test script:
---------------
Psy Shell v0.7.2 (PHP 5.6.24 — cli) by Justin Hileman
>>> $zip = new ZipArchive()
=> ZipArchive {#185
     +"status": 0,
     +"statusSys": 0,
     +"numFiles": 0,
     +"filename": "",
     +"comment": "",
   }
>>> $zip->open('/tmp/tmp.zip', ZipArchive::CREATE)
=> true
>>> $zip->addFile('/tmp/tmp.txt')
=> true
>>> $zip->close()
PHP warning:  ZipArchive::close(): Renaming temporary file failed: No such file or directory on line 1
>>>

The /tmp/tmp.txt file exists.

Expected result:
----------------
I expect it to create the zip file without warning.

Actual result:
--------------
PHP warning:  ZipArchive::close(): Renaming temporary file failed: No such file or directory on line 1


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-08-12 11:52 UTC] cmb@php.net
-Operating System: Windows 8.1 +Operating System: Cygwin
 [2016-08-12 11:52 UTC] cmb@php.net
Works as expected on native Windows 10; most likely a Cygwin issue.
 [2016-12-28 11:48 UTC] pharscape at gmail dot com
On Windows 10 I found that if you add a delay between the addFile() and close() this <random> error disappears.
 [2018-02-15 07:41 UTC] small75 at list dot ru
Hi!
Same problem on
Windows 10 Pro 1709
XAMPP for Windows
PHP Version 5.6.31
Apache/2.4.26 (Win32) OpenSSL/1.0.2l PHP/5.6.31 

PHP Warning:  ZipArchive::close(): Renaming temporary file failed: No such file or directory in
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Tue Aug 20 13:01:27 2019 UTC