PHP和权限 [英] PHP and Permissions

查看:92
本文介绍了PHP和权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近搬到我的网站到一个新的主机,现在我遇到了一些碎code ..

I recently moved my website to a new host and now am experiencing some broken code..

我有一个上传脚本,现在返回这样的:

I have an uploading script that is now returning this:

move_uploaded_file()以未能打开
  流:权限被拒绝在* ..

move_uploaded_file() failed to open stream: Permission denied in *..

我已经设置上传目录777这工作得很好,但需要我的脚本有顶级权限。

I've set the upload directory to 777 which worked fine, but my script is needed to have top level permissions..

(由于脚本本身设置权限的目录,确实抄袭等地段)

(As the script itself sets permission to directories, does lots of copying etc)

有没有apache的一种方法,我可以将PHP脚本到所有文件夹的所有者我的服务器上?

Is there a way in apache I can set the PHP script to the owner of all the folders on my server?

感谢

同时
当在寻找的phpinfo()

Also When looking in phpInfo()


apache2handler

User/Group  nobody(99)/99 

时此有关?

推荐答案

好,
当你试图设置,如0777的许可,您必须在相同的权限运行。

well, When you are trying to set the permission like "0777", you must be running on same authority.

我的意思是。
例如,你的脚本告诉更改文件夹/文件权限为0777,但是文件夹或文件已经有一个许可,那就是'0755',所以你无权做出的改变。作为用户只有 5 的权限。

不是,您需要登录到FTP和更改文件夹的权限为0777,然后你必须完全控制权限,或者你必须坚持使用0755或类似的。

Either, you need to login to FTP and change the folder permission to 0777 and then you have full control over it or you have to stick with using 0755 or similar.

这篇关于PHP和权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆