我遇到过一些使用 Bluehost 安装 WordPress 的案例,我的 WordPress 主题出现错误,因为上传文件夹 wp-content/uploads
不存在。
显然,Bluehost cPanel WordPress 安装程序不会创建此文件夹,但 HostGator 会。
所以我需要将代码添加到我的主题中,以检查文件夹并以其他方式创建它。
原文由 Scott B 发布,翻译遵循 CC BY-SA 4.0 许可协议
我们可以使用 mkdir
创建文件夹。我们也可以为它设置权限。
> Value Permission > 0 cannot read, write or execute > 1 can only execute > 2 can only write > 3 can write and execute > 4 can only read > 5 can read and execute > 6 can read and write > 7 can read, write and execute > > ```
<?PHP
// Making a directory with the provision // of all permissions to the owner and // the owner’s user group mkdir(“/documents/post/”, 0770, true)
?>
”`
原文由 Ashok kumawat 发布,翻译遵循 CC BY-SA 4.0 许可协议
1 回答4.1k 阅读✓ 已解决
3 回答1.9k 阅读✓ 已解决
2 回答2.3k 阅读✓ 已解决
1 回答1.4k 阅读✓ 已解决
2 回答723 阅读✓ 已解决
2 回答2.3k 阅读
1 回答687 阅读✓ 已解决
试试这个,使用 mkdir :
请注意,
0777
已经是目录的默认模式,可能仍会被当前的 umask 修改。