Jump to content

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...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.