Gemorroj / Archive7z

This library provides handling of 7z files in PHP
GNU Lesser General Public License v3.0
89 stars 20 forks source link

Hello, what is the problem causing this error? #34

Closed nottellyou closed 1 year ago

nottellyou commented 1 year ago

Hello, what is the problem causing this error?

Binary of 7-zip is not available
root@:~# ls -l /usr/bin/7z
-rwxr-xr-x 1 www root 39 Aug 15  2020 /usr/bin/7z
root@:~# 7z -version

7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
p7zip Version 16.02 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,64 bits,1 CPU AMD EPYC 7601 32-Core Processor                 (800F12),ASM,AES-NI)

Debian11.6, php7.4.33

Gemorroj commented 1 year ago

Hi. look at this function https://github.com/Gemorroj/Archive7z/blob/5.5.0/src/Archive7zTrait.php#L47 An plz, show me the example of your code.

nottellyou commented 1 year ago

Hi, @Gemorroj : These are my code:

    if(strcasecmp(PHP_OS, 'WINNT') == 0) {
        $obj = new Archive7z($filename, $exepath);
    }else{
        $obj = new Archive7z($filename);//-- Here will cause the error
    }
    $count = count($obj->getEntries());

I try to use $obj = new Archive7z($filename, '/usr/bin/7z'); , but the error still shows. I have no idea.

nottellyou commented 1 year ago

Oh, I know the problem is open_dir .

But I found another problem, gibberish

?????????rarzip
hosts    772.31KB
??????????.jpg    4.37KB
snipaste20230511_144615.jpg    33.85KB
0_cleanup.jpg    28.82KB

The test file: http://50.116.14.233/171829s6ygqmhhh9jgycch.rar

Gemorroj commented 1 year ago

@nottellyou yes, it's known problem. see https://github.com/Gemorroj/Archive7z/issues/15 or https://github.com/Gemorroj/Archive7z/issues/31