如何在文件夹中使用chmod使其对服务器可写 [英] How to chmod the folder to make it writable for the server in php

查看:101
本文介绍了如何在文件夹中使用chmod使其对服务器可写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何对文件夹进行chmod处理以使其可在php中写入服务器?

我正在使用如下所示的功能

chmod("/images/original", 0750);

,但仍然没有写file的权限.为什么?

解决方案

如果您的网络服务器所运行的用户没有写访问权限,则很可能不是该文件的所有者,因此也无法更改权限.

要为您的Web服务器进程允许对该文件进行写访问,请更改所有权(chown)或在Shell上允许足够的写许可(chmod).

How to chmod the folder to make it writable for the server in php ?

I am using this function chomd as following

chmod("/images/original", 0750);

but still don't have the permission to write file . why ?

解决方案

If the user your webserver runs on has no write access then it most likely is not the owner of the file, and therefore it cannot change permissions either.

To allow write access on the file for your webserver process either change the ownership (chown) or allow sufficient write permissions (chmod) on a shell.

这篇关于如何在文件夹中使用chmod使其对服务器可写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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