English 中文(简体)
提取 php 的 rar 文件失败, 警告失败
原标题:Extract rar file with php failed with warning
  • 时间:2012-05-24 04:40:20
  •  标签:
  • php

我刚刚安装了php rar 扩展范围,并以以下http://www.php.net/manual/en/rar.examples.php

但失败了, 文件名被打印出来, 不管有没有文件被加满, 我看到了战争:~ ~

RarEntry: Extract () [rarentr.extract: ERAR_ECREATE 内 [rAR_ECREATE 插入]

<?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() . "
";

    $entry->extract( /dir/extract/to/ );
}

rar_close($rar_file);

?>

我通过谷歌找了一阵子,但是没有运气,怎么了?谢谢!谢谢!

我已经自己解决了

it is due to destination folder permission I give the folder 777 ,then it works.

问题回答

此答复由作者 原版张贴为编辑版

I solved it by myself already. it is due to destination folder permission I give the folder 777 ,then it works.

请不要给该文件夹 777 权限 。 但是要更改文件夹的所有人, 用户可操作 php 命令。 在我的案例中, 目录属于 < code> root 和 php 运行于 apache 服务器的用户。 我所做的是 :

chown 用户: 用户 my_ directory





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签