zipArchive open error in PHP

☆樱花仙子☆ 提交于 2019-11-29 16:36:15

I think that your issue has to be something with the php version, sounds like it's this: (from php.net comments):

Some older PHP versions used to return false if zip_open failed, and newer versions return the number of error (as integer), so instead of this:

$zip = zip_open($zip_file);
if ($zip) {
  // consider zip file opened successfully
}

use this:

$zip = zip_open($zip_file);
if (is_resource($zip)) {
  // consider zip file opened successfully
}

Sounds like you are getting the first non numeric index from the array, maybe '1' as 'true' and that's why it's displaying the element '1' on your errors array

First, check if you can create files with php on server side. There may be an identity problem. php may operate on i.e: apache id and your id is yourFtpId..

Then check if zip library is supported with php on the server, phpinfo can show that.

Then check if your server configuration allows zip commands from php.

When these diagnostics are over, if you find a problem with these, you should address the server admin to solve them.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!