Jump to content

PHP using 7zip


Recommended Posts

7zip has an amazing compression ratio. almost 50% better than .zip, i think.

 

PHP's zip library supports the .zip compression format and zlib in PHP supports the .gz compression format...but as gluck suggested, you might have to use PHP's exec() to run a system call to handle the 7zip format. make sure exec() hasn't been disabled in php.ini and note that if your PHP is on safe_mode, you might have to overcome some issues. Just look up 'safe_mode in php.ini' in the manual.

Link to comment
https://forums.phpfreaks.com/topic/45981-php-using-7zip/#findComment-230552
Share on other sites

Thanks! I didn't know it could be done automatically through the command line like that ^^

 

It's working great now :)

 

Just 1 more question please.. how can I make it so that it uses whatever I have set as the default settings? Instead of having to include all of the settings in the command line?

Link to comment
https://forums.phpfreaks.com/topic/45981-php-using-7zip/#findComment-235838
Share on other sites

  • 2 weeks later...

I have configured 7zip to use very high compression to make very small files, so it makes say a 7meg file instead of the 220meg file it does with the default settings.

 

When I right click something and click 7zip>add to archive then it will use the settings that I set it to instead of default settings.

 

Is there a way to do this in PHP, or to manually add these settings to the command line? Like dictionary size and compression level and all that good stuff? Please? :D

Link to comment
https://forums.phpfreaks.com/topic/45981-php-using-7zip/#findComment-243327
Share on other sites

I have configured 7zip to use very high compression to make very small files, so it makes say a 7meg file instead of the 220meg file it does with the default settings.

 

When I right click something and click 7zip>add to archive then it will use the settings that I set it to instead of default settings.

 

Is there a way to do this in PHP, or to manually add these settings to the command line? Like dictionary size and compression level and all that good stuff? Please? :D

 

 

oh ok, well since you are running it via exec(), PHP can't do anything about the settings.

 

in any case, i'm not sure about the settings either. i think you probably have to set those settings when you configure the 7zip library before you compile to install it.

 

sorry i can't help, i'm not familiar with 7zip. maybe you can look it up on their site?

Link to comment
https://forums.phpfreaks.com/topic/45981-php-using-7zip/#findComment-243453
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.