【发布时间】:2011-01-19 04:33:25
【问题描述】:
我遇到过一些使用 Bluehost 安装 WordPress 的案例,我的 WordPress 主题出现错误,因为上传文件夹 wp-content/uploads 不存在。
显然 Bluehost cPanel WordPress 安装程序不会创建此文件夹,但 HostGator 会。
所以我需要向我的主题添加代码来检查文件夹并以其他方式创建它。
【问题讨论】:
-
if (!file_exists('path/to/directory')) { mkdir('path/to/directory', 0777, true); }