写入文件 ../uploads/allimg/100407/1-10040G40556.jpg 失败

来源:互联网 发布:three.js vr demo 编辑:程序博客网 时间:2024/06/05 06:55
解决方案:修改/install/index.php,在开始处加上一行即可。

原始代码:
<?php
@set_time_limit(0);

修 改后的代码:
<?php
$cfg_dir_purview = 0755;
@set_time_limit(0);

原 因分析:
我在linux下安装失败。因为/include/dedemodule.inc.php的WriteFiles函数里用 到$GLOBALS['cfg_dir_purview']来设置文件权限。原始代码如下。
function WriteFiles($hashcode,$isreplace=3)
{
// ...
if(!is_dir($filename))
{
@mkdir($filename,$GLOBALS['cfg_dir_purview']);
}
@chmod($filename,$GLOBALS['cfg_dir_purview']);

此 处,$cfg_dir_purview变量是在/include/common.inc.php中定义的。但/install/index.php没有引 用它。因此@mkdir和@chmod都不能正确设置权限。