Install php_rar extension in php to implement rarfile reading and decompression

Source: Internet
Author: User
Php installation of php_rar extension for rarfile reading and decompression methods this article describes how php installation of php_rar extension for rarfile reading and decompression methods. We will share this with you for your reference. The details are as follows:

PHP Rar Archiving module (php_rar) is a module for reading and decompressing rarfiles, but it does not provide RAR compression (packaging.

1. first download the DLL on the RAR page of PECL. select the corresponding version as needed.

PHP version requirements: the php_rar module is applicable to php 5.2 and later versions. However, for windows systems, it seems that only the DLL corresponding to php5.3/5.4 is downloaded.

2. download a zip package and decompress the php_rar.pdb and php_rar.dll files to the ext subdirectory under the PHP installation directory.

3. add a line of php_rar extension reference declaration in php. ini: extension = php_rar.dll

4. if the Apache server is used, restart Apache. PHP loaded in FastCGI mode in IIS does not need further operations.

5. write a test file to see if there are any problems.

6. if any problem occurs, view the server log file.

With the official test code test-rar.php:

 extract($dir_to_extract_to);/* OR */// this will create only one new file $new_entry_name in $dir_to_extract_to$entry->extract('', $dir_to_extract_to.'/'.$new_entry_name);// this line is really not necessaryrar_close($rar);?>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.