How to chmod 0007 a lot of directories with php? [duplicate]

荒凉一梦 提交于 2019-11-29 16:20:44
foreach(['./users','./mp3','./pdf'] as $path){
    array_map(function ($val){
        return shell_exec ("chmod 0777 $val");
    }, glob("$path/*"));
}

Stumbled on this: PHP mkdir: PHP mkdir: Permission denied problem

They suggested this: chown -R www-data:www-data /var/www/example.com/public_html/ chmod -R g+rw /var/www/example.com/public_html/

It actually worked.

Thanks :)

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!