Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

shakogele's avatar

ZipArchive::close(): Failure to create temporary file: No such file or directory'

Hello,

I am using Laravel 5.2 and "maatwebsite/excel": "~2.1.0", plugin to generate Excel Data. on localhost where I have windows OS everything works fine but when I upload application to Debian webserver ( php 5.6 ) I get following error ZipArchive::close(): Failure to create temporary file: No such file or directory' which is logged in laravel.log file.

can anybody suggest something??

thanks

0 likes
3 replies
shakogele's avatar
shakogele
OP
Best Answer
Level 8

Problem wan on Server tmp folder was not same as basedir directory at apache2.conf,

 php_admin_value open_basedir /home/admin/web/root/public_html:/home/admin/tmp

laraadmin's avatar

You can update php.ini file for

sys_temp_dir="/Applications/XAMPP/xamppfiles/temp/"

Restart Apache once done.

luciandex's avatar

In some cases, the problem is that folders created in storage/app that have symlink to public/storage/app not show in the last. So, if we have a newly created folder, eg: storage/app/newFolder, that will not be present in public/storage/app/newFolder, and when we want to create a Zip there, will throw an error.

The solution can be that programatically create that folder, before any other action on storage, to make sure that the folder is available. After creating that folder, will retrieve files from corespondent location in /storage/app/newFolder.

1 like

Please or to participate in this conversation.