Hi
is there any way to unrar/rar files on bluehost?
Hi
is there any way to unrar/rar files on bluehost?
Using the command line? No.
If you want to archive/unarchive files using the command line, you probably want to use the tar command which deals with Gzip/TAR archives (.tar.gz or .tgz). More info here.
An example to extract a .tar.gz file:
Code:tar -zxvf file.tar.gz
And any other way? not using the command line, php or something?
I need rar extraction unfortunatley.
Well, I doubt Bluehost has any rar or unrar packages installed, but try this with a sample rar file to see if it will extract it:
If that doesn't work, tryCode:unrar x [filename.rar]
Again, I doubt those will work, but it's worth a try.Code:rar e [filename.rar]
Otherwise, a solution for PHP. First you have to install the RAR PHP extension.
From the command line, try running pecl -v install rar. If that doesn't work, you'll have to install it manually.
I believe that using the Rar package is the only way to get Rar support for PHP. Anyway, if you get it installed, here is a sample script that extracts a RAR archive:
Besides using PHP or the command line, I don't know of any other way to extract RAR files on Bluehost. I suppose there is some other way to do it in Ruby or Perl, but I don't have any familiarity with other programming languages than PHP.PHP Code:<?php
$rar_file = rar_open('example.rar') or die("Can't open Rar archive");
$entries = rar_list($rar_file);
foreach ($entries as $entry) {
echo 'Filename: ' . $entry->getName() . "\n";
echo 'Packed size: ' . $entry->getPackedSize() . "\n";
echo 'Unpacked size: ' . $entry->getUnpackedSize() . "\n";
$entry->extract('/dir/extract/to/');
}
rar_close($rar_file);
?>![]()
Last edited by Eriksrocks; 07-12-2008 at 05:41 PM.
Thanks for your nice help Erik, im kind of newbie. where is the "command line" located?
You need to request SSH access from the SSH section of cPanel by uploading or sending in a valid Photo ID (Security > Shell Access). Once you have it enabled on your account, you can use a free SSH client like PuTTY to connect to your server. From there, you can login and execute commands.
EDIT: Just a question: Why do you need RAR support on the webserver? Can you just extract files manually on your PC and then upload them?![]()
@ice2thesea
Did You Managed To rar/Unrar Files
I Used Php Script, But Did Not Worked For Me
I Get Error with raropen()
I had RAR Installed And php.ini Configured
Is there some particular reason that you need to use just about the only compression format that the server doesn't natively support instead of one of the more standard ones such as zip or gzip?