在root linux服务器上上传文件的问题

发布于 2024-09-07 14:17:52 字数 439 浏览 10 评论 0原文

我在 1and1 上有一个 Plesk 面板和 root 专用服务器。我正在使用自定义编程的 php 脚本上传文件并创建文件夹到服务器。我有一个名为 upload_data_folder 的上传文件夹,具有 777 权限。

场景如下: 我想在我的 upload_data_folder 中创建文件夹,然后在新创建的文件夹中上传文件。我是通过 php 脚本执行此操作,因此我创建的每个文件或文件夹都有 apache 用户和组作为所有者。

  1. 我成功地将文件夹创建在我的 upload_data_folder 中,并且该文件夹归 apache 所有,将 apache 作为一个组并拥有 777 权限。然后,当我尝试将一些文件上传到新创建的文件夹时,它不能。

我认为问题在于某些所有者的许可,但如果有人知道这可能是什么,我将非常感激

I have a plesk panel and root dedicated server on 1and1. I'm using custom programed php script to upload the files and create the folders to server. I have the upload folder named upload_data_folder with the 777 permission.

The scenario is the following:
I want to create folder in my upload_data_folder and than upload files in that newly crated folder. I'm doing this over php script so every file or folder that I create has apache user and the group as the owner.

  1. I'm successfully crate the folder in my upload_data_folder and that folder is owned by apache, has apache as a group and has 777 premission. Then When I try to upload some files to that newly created folder It can't.

I think the problem is with some owner permission but if anyone has some idea what this can be I would be very grateful

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

朱染 2024-09-14 14:17:52

这是我定制的脚本。 huuu我解决了这个问题。 php安全模式已开启。我将其关闭后,一切正常。

It was my custom made script. huuu I solved the problem. The php safe mode was turned on. After I turned it off everything works perfectly.

忆悲凉 2024-09-14 14:17:52

默认情况下apache文档根目录是/var/www/html/。如果安装了 plesk,文档根目录将具有类似以下的路径:/var/www/httpdocs(对于非安全站点)。因此,安全站点存储在 /var/www/httpsdocs 中。

By default apache document root is /var/www/html/. If plesk is installed document root will have a path like:/var/www/httpdocs for non-secure sites. Thus secure sites are stored in /var/www/httpsdocs.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文