function set_upload_path($path) {
if (file_exists ( $path )) {
if (! is_writeable ( $path )) {
chmod ( $path, '0777' );
}
} else {
mkdir ( $path, '0777' , true);
}
//return $path;
}
使用以上代码在服务器创建一个目录权限是01411 用ftp可以修改权限.
但是参数设置为0666 查看权限就成了01311 不可删除也不可修改权限
求高人指导!
if (file_exists ( $path )) {
if (! is_writeable ( $path )) {
chmod ( $path, '0777' );
}
} else {
mkdir ( $path, '0777' , true);
}
//return $path;
}
使用以上代码在服务器创建一个目录权限是01411 用ftp可以修改权限.
但是参数设置为0666 查看权限就成了01311 不可删除也不可修改权限
求高人指导!
解决方案 »
- GBK转UTF8问题。。。
- PHP连sql server出错
- syntax error, unexpected $end
- js传递参数到php页面问题
- [有图] 有对discuz有了解的吗 请问portal中的一个频道栏目列表怎么单独成一个网页呢
- 表格里显示字符不完整
- 怎样得到一个时间戳的当天、当月、当年的起始时间戳?
- 如何在一个页面内定位指定的查询记录项?怎样才能获得它是第几个记录?
- 我使用ODBC连接Visual Foxpro 6.0时的日期查询问题
- php判断手机访问,默认模板是web目录,改成:判断是不是手机访问,如果是就选择mobile模板
- php返回值
- 在一个服务器上能否提交资料到多个服务器上。
在PHP里面输出0777是511 把他改成511服务器上的chmod ( $path, '511' );权限就变成0777
他把十进制的自动转换为了八进制
mode
The mode is 0777 by default, which means the widest possible access. For more information on modes, read the details on the chmod() page.Note:mode is ignored on Windows.Note that you probably want to specify the mode as an octal number, which means it should have a leading zero. The mode is also modified by the current umask, which you can change using umask().这里明确告诉你要在一开始加了0,就是八进制,如果不加0开始就是10进制