PHP的mkdir和Apache所有权 [英] PHP mkdir and apache ownership

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

问题描述

有没有一种方法来设置PHP在Apache运行后创建与创建它,而不是被Apache所拥有?在程序的所有者拥有该文件夹的文件夹

Is there a way to set php running under apache to create folders with the folder owned by the owner of the program that creates it instead of being owned by apache?

使用Word preSS是由他们在运行网站创建新的文件夹上传到但这些是由apache.apache拥有,并非如此。这也发生使用ostickets。现在我们已经通过SSH进入服务器和chmod的文件夹,但它似乎会有一个设置的地方来覆盖它做任何程序之外的所有权。

Using word press it creates new folders to upload into but these are owned by apache.apache and not by the site that they are running in. This also happens using ostickets. For now we have to SSH into the server and chmod the folder, but it would seem there would be a setting somewhere to override the ownership outside of any program that does it.

推荐答案

safe_mode设置是打开你的服务器上。功能的mkdir()创建具有所有者(阿帕奇,无,..),不同的当前脚本所有者的文件夹中。和脚本不能上传(移动,复制)文件与另一个所有者该文件夹(即不喜欢当前的脚本所有者)。

Safe_mode is turn on on your server. The function mkdir() creates folder with owner ("apache", "none", ..) that different of the current script owner. And scripts couldn't upload (move, copy) files into that folder with another owner (that is not like current script owner).

停用 safe_mode设置,这将是工作。

请参阅 http://php.net/manual/en/features.safe -mode.php 了解详情。

P.S。随着使 safe_mode设置不能使用 CHMOD()在PHP函数。

P.S. With enable safe_mode you can't use chmod() function in php.

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

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