我在使用 Perl 创建目录时遇到问题:
$country = 7;
$city = 12;
$uploadFolder = "/opt/v-hosts/user/html/images/h_photos/ls";
$destination = $uploadFolder;
mkdir($destination) if(!-e $destination);
$destination .= "/$country";
mkdir($destination,0755) if(!-e $destination);
$destination .= "/$city";
mkdir($destination,0755) if(!-e $destination);
当我尝试执行此代码时,它应该创建以下目录:
/opt/v-hosts/user/html/images/h_photos/ls/7/12
不幸的是,代码返回错误:
mkdir /opt/v-hosts/user/html/images/h_photos/ls/7:/opt/v-hosts/user/epbin/ls.cgi 第 1376 行的权限被拒绝。\n
我尝试将ls
文件的权限更改为777,但没有解决问题。