Jump to content

extracting a rar file


ParK

Recommended Posts

i try to extract a rar file via php but i get an error:

 

Fatal error: Call to undefined function: rar_open() in --parksdiary.com/httpdocs/rar2.php on line 8

 

my codes:

 

<?php



$filename = "file.rar";
$filepath = "/rar_ac";

$rar_file = rar_open($filepath.$filename); <--- here is the rar_open function line
$list = rar_list($rar_file);
foreach($list as $file) {
   $entry = rar_entry_get($rar_file, $file);
   $entry->extract("."); 
}
rar_close($rar_file);

?> 

 

i dont understand why iam getting this error  ??? may you help me ?

Link to comment
https://forums.phpfreaks.com/topic/53378-extracting-a-rar-file/
Share on other sites

  • 3 months later...

I'm getting this same error. I followed the instructions form http://www.php.net/rar.

 

I first tried the normal installation

 

gunzip rar-xxx.tgz
tar -xvf rar-xxx.tar
cd rar-xxx
phpize
./configure && make && make install

 

make install ran successful but rar_open never worked.

 

So I tried the PECL installer to install the Rar extension, using the following command: pecl -v install rar.

 

Still, ever after server restarts from each install, rar_open keeps returning the same error: Fatal error: Call to undefined function rar_open() in ....

 

Any ideas?

 

I'm running PHP Version 5.2.2

Link to comment
https://forums.phpfreaks.com/topic/53378-extracting-a-rar-file/#findComment-352074
Share on other sites

  • 4 months later...

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.