Report this

What is the reason for this report?

Could not close zip file php://output

Posted on November 7, 2013

I have this error since I transferred my website to digital ocean VPS. I want to export a file, this file will be saved on my computer, but it is not working anymore because I have this error.

I checked the /tmp and /var/zpanel/temp directory, but they have full rights.

Logging from my opencart: 2013-11-07 9:49:30 - PHP Warning: realpath(): open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (/var/zpanel/hostdata/zadmin/public_html/domain_com:/var/zpanel/temp/) in /var/zpanel/hostdata/zadmin/public_html/domain_com/system/PHPExcel/Classes/PHPExcel/Shared/File.php on line 136 2013-11-07 9:49:30 - PHP Warning: tempnam(): open_basedir restriction in effect. File() is not within the allowed path(s): (/var/zpanel/hostdata/zadmin/public_html/domain_com:/var/zpanel/temp/) in /var/zpanel/hostdata/zadmin/public_html/domain_com/system/PHPExcel/Classes/PHPExcel/Writer/Excel2007.php on line 205 2013-11-07 9:49:35 - PHP Exception: Could not close zip file php://output. in /var/zpanel/hostdata/zadmin/public_html/domain_com/system/PHPExcel/Classes/PHPExcel/Writer/Excel2007.php on line 378



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

I add this to my php.ini, open_basedir = /tmp <br> <br>but error is still there

Make sure the drive you’re trying to save to isn’t full. I wish I’d seen that suggestion before this never-ending morning…

@jelwin: zPanel does not allow scripts to write to /tmp. You have to modify your script so that it writes to <code> /var/zpanel/temp/</code> instead.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.