压缩zip提示以下错误的解决方法

Fatal error: Uncaught ValueError: fread(): Argument #2 ($length) must be greater than 0 in /******/app/kod/archiveLib/pclzip.class.php:2704 Stack trace: #0 /******/app/kod/archiveLib/pclzip.class.php(2704): fread() #1 /******/app/kod/archiveLib/pclzip.class.php(2525): PclZip->privAddFile() #2 /******/app/kod/archiveLib/pclzip.class.php(2427): PclZip->privAddFileList() #3 /******/app/kod/archiveLib/pclzip.class.php(2162): PclZip->privAddList() #4 /******/app/kod/archiveLib/pclzip.class.php(424): PclZip->privCreate() #5 /******/app/kod/KodArchive.class.php(308): PclZip->create() #6 /******/app/controller/explorer.class.php(997): KodArchive::create() #7 /******/app/core/Application.class.php(64): explorer->zip() #8 /******/app/core/Application.class.php(104): Application->appRun() #9 /******/index.php(6): Application->run() #10 {main} thrown in /******/app/kod/archiveLib/pclzip.class.php on line 2704

打开文件/app/kod/archiveLib/pclzip.class.php,转到2703

将:

$v_content = @fread($v_file, $p_header['size']);

修改为:

if($p_header['size']>0){
    $v_content = @fread($v_file, $p_header['size']);
}

压缩tar/gzip提示以下错误的解决方法

Fatal error: Uncaught Error: Undefined constant "filename" in /******/app/kod/archiveLib/pcltar.lib.php:1863 Stack trace: #0 /******/app/kod/archiveLib/pcltar.lib.php(1602): PclTarHandleHeader() #1 /******/app/kod/archiveLib/pcltar.lib.php(1395): PclTarHandleAddFile() #2 /******/app/kod/archiveLib/pcltar.lib.php(1089): PclTarHandleAddList() #3 /******/app/kod/archiveLib/pcltar.lib.php(132): PclTarHandleCreate() #4 /******/app/kod/KodArchive.class.php(323): PclTarCreate() #5 /******/app/controller/explorer.class.php(997): KodArchive::create() #6 /******/app/core/Application.class.php(64): explorer->zip() #7 /******/app/core/Application.class.php(104): Application->appRun() #8 /******/index.php(6): Application->run() #9 {main} thrown in /******/app/kod/archiveLib/pcltar.lib.php on line 1863

[hide]用不到,还没写。。。[/hide]

最后修改:2023 年 11 月 24 日
如果觉得我的文章对你有用,请随意赞赏