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 不可删除也不可修改权限
求高人指导!

解决方案 »

  1.   

    我仔细弄了下发现是这里出了问题mkdir ( $path, '511' , true);
    在PHP里面输出0777是511  把他改成511服务器上的chmod ( $path, '511' );权限就变成0777
    他把十进制的自动转换为了八进制
      

  2.   

    以下摘自PHP在线手册:http://hk.php.net/manual/en/function.mkdir.php
    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进制