我尝试执行此代码以在userdata / profile_pics中创建一个文件夹:
$chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
$rand_dir_name = substr(str_shuffle($chars), 0, 15);
mkdir("userdata/user_photos/$rand_dir_name");
但它会出现以下错误:
Warning: mkdir(): Permission denied in /opt/lampp/htdocs/findfriends/account_settings.php on line 88
如何使代码有效?
答案 0 :(得分:-2)
您必须使用写权限为user_photos设置permsissions .. https://help.ubuntu.com/community/FilePermissions