在root linux服务器上上传文件的问题
我在 1and1 上有一个 Plesk 面板和 root 专用服务器。我正在使用自定义编程的 php 脚本上传文件并创建文件夹到服务器。我有一个名为 upload_data_folder 的上传文件夹,具有 777 权限。
场景如下: 我想在我的 upload_data_folder 中创建文件夹,然后在新创建的文件夹中上传文件。我是通过 php 脚本执行此操作,因此我创建的每个文件或文件夹都有 apache 用户和组作为所有者。
- 我成功地将文件夹创建在我的 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.
- 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是我定制的脚本。 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.
默认情况下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.