Azu Posted April 7, 2007 Share Posted April 7, 2007 Please tell me how I can have PHP compress and decompress files using 7zip? Quote Link to comment https://forums.phpfreaks.com/topic/45981-php-using-7zip/ Share on other sites More sharing options...
gluck Posted April 11, 2007 Share Posted April 11, 2007 why do u wann use 7zip? Quote Link to comment https://forums.phpfreaks.com/topic/45981-php-using-7zip/#findComment-226419 Share on other sites More sharing options...
Azu Posted April 11, 2007 Author Share Posted April 11, 2007 Because I can compress ~2gigabytes of automatic backups into a ~6megabyte file with it. Quote Link to comment https://forums.phpfreaks.com/topic/45981-php-using-7zip/#findComment-226797 Share on other sites More sharing options...
gluck Posted April 13, 2007 Share Posted April 13, 2007 The only I think you can do it is use php to execute an external command like system etc. and then perform the operation. PHP's built in zip support would not use 7zip though. Quote Link to comment https://forums.phpfreaks.com/topic/45981-php-using-7zip/#findComment-228667 Share on other sites More sharing options...
Koobi Posted April 16, 2007 Share Posted April 16, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/45981-php-using-7zip/#findComment-230552 Share on other sites More sharing options...
Azu Posted April 23, 2007 Author Share Posted April 23, 2007 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? Quote Link to comment https://forums.phpfreaks.com/topic/45981-php-using-7zip/#findComment-235838 Share on other sites More sharing options...
Koobi Posted May 1, 2007 Share Posted May 1, 2007 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? that's very vague i'm not sure what you mean by 'settings' Quote Link to comment https://forums.phpfreaks.com/topic/45981-php-using-7zip/#findComment-242754 Share on other sites More sharing options...
Azu Posted May 2, 2007 Author Share Posted May 2, 2007 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? Quote Link to comment https://forums.phpfreaks.com/topic/45981-php-using-7zip/#findComment-243327 Share on other sites More sharing options...
Koobi Posted May 2, 2007 Share Posted May 2, 2007 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? 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? Quote Link to comment https://forums.phpfreaks.com/topic/45981-php-using-7zip/#findComment-243453 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.