Forum und email

Rar Functions


Rar is a powerful and effective archiver created by Eugene Roshal. This extension gives you possibility to read Rar archives but doesn't support writing Rar archives, because this is not supported by UnRar library and is directly prohibited by it's license.

More information about Rar and UnRar can be found at »

요구 조건

이 확장을 빌드할 때 외부 라이브러리가 필요하지 않습니다.

실행시 설정

이 확장은 php.ini 설정이 존재하지 않습니다.


Rar is currently available through PECL »

Also you can use the PECL installer to install the Rar extension, using the following command: pecl -v install rar.

You can always download the tar.gz package and install Rar by hand:

Example#1 Rar installation

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

Windows users can download the extension dll php_rar.dll here: »


There is one resource used in Rar extension: a file descriptor returned by rar_open().

예약 상수

RAR_HOST_MSDOS (integer)
RAR_HOST_OS2 (integer)
RAR_HOST_WIN32 (integer)
RAR_HOST_UNIX (integer)
RAR_HOST_BEOS (integer)


Example#2 Rar extension overview example


rar_open('example.rar') or die("Can't open Rar archive");

$entries rar_list($rar_file);

foreach (
$entries as $entry) {
'Filename: ' $entry->getName() . "\n";
'Packed size: ' $entry->getPackedSize() . "\n";
'Unpacked size: ' $entry->getUnpackedSize() . "\n";




This example opens a Rar file archive and extracts each entry to the specified directory.

Table of Contents