English 中文(简体)
ZipArchive php把卷宗作为根基。 为什么?
原标题:ZipArchive php class extract files as root. Why?

我有一份网址:

$extract_dir = "./";
$extract_file = "extractME.zip";

$zip = new ZipArchive;
$res = $zip->open($extract_file);
if ($res === TRUE) {
    $zip->extractTo($extract_dir);
    $zip->close();
    echo "ok";
} else {
    echo "failed";
}

但是,当我通过

所有关于FTP的档案都含有最低生活标准,但不是使用者,而是新用户。 因此,用户可以查阅这些档案。

能否确定这种任何情况(我拥有服务器),这些档案将摘自美国国际宇宙航行科学院。

问题回答

由于某种原因,您的网络服务器(台式服务器)正在成为根基,因此它所立的任何档案都将成为根基。 绝不应如此。 apache通常作为www-data或httpd ,或者没有人,或者根据lin子分类。

我建议你从一个行政角度来看待这一问题,在你最终被利用之前,有人向你们提出。 (假设这是一个活服务器)

您可使用www.org。 php.net/chown功能或你可以在指挥线上指挥,或从PHP指挥,拥有类似系统或外部功能。

Good luck.





相关问题
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 ...

热门标签