免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3052 | 回复: 6
打印 上一主题 下一主题

[求助] ERROR: Specified ROOT dir [./tpl\] is not a directory 模板 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-06-14 09:34 |只看该作者 |倒序浏览
Apache/2.0.53 (Unix) DAV/2 PHP/5.1.2, 使用了class.rFastTemplate模板, 在我机器上使用都没问题, 但是放在服务器上后, 出现这个错误.

论坛徽章:
1
技术图书徽章
日期:2013-12-05 23:25:45
2 [报告]
发表于 2006-06-14 09:37 |只看该作者
不是提示了么?

你用绝对路径标示模板看看。

另外,是否没有操作权限。

论坛徽章:
0
3 [报告]
发表于 2006-06-14 10:34 |只看该作者
改成项目的绝对路径后还是不行
   4 drwxr-xr-x    8 mysql    games        4096 Jun 14 10:33 design
在工程名design下面的phpinfo.php没问题

论坛徽章:
1
技术图书徽章
日期:2013-12-05 23:25:45
4 [报告]
发表于 2006-06-14 10:42 |只看该作者
chmod -R 777 你的目录

然后看看你的那个类里面:Specified ROOT
这个地方,输出的路径应该为你修改后的实际路径啊

论坛徽章:
0
5 [报告]
发表于 2006-06-14 10:53 |只看该作者
chmod后不行. 在类中, 对function set_root()是这样介绍的:
   // Description
   //    This was lifted as-is from class.FastTemplate.php3.  Based on what
   //    platform is in use, it makes sure the path specification ends with
   //    the proper path separator; i.e., a slash on unix systems and a
   //    back-slash on WIN32 systems.  When we can run on Mac or VMS I guess
   //    we'll worry about other characters....
   //
   //    $root can now be an array of template roots which will be searched to
   //    find the first matching name.
   function set_root ($root) {

      if (!is_array($root)) {
         $trailer = substr ($root, -1);
         if ($trailer != ($this->WIN32 ? '\\' : '/'))
            $root .= ($this->WIN32 ? '\\' : '/');

         if (!is_dir($root)) {
            $this->error ("Specified ROOT dir [$root] is not a directory", true);
            return false;
         }
         $this->ROOT[] = $root;
      } else {
         reset($root);
         while(list($k, $v) = each($root)) {
            if (is_dir($v)) {
               $trailer = substr ($v,-1);
               if ($trailer != ($this->WIN32 ? '\\' : '/'))
                  $v .= ($this->WIN32 ? '\\' : '/');
               $this->ROOT[] = $v;
            } else
               $this->error ("Specified ROOT dir [$v] is not a directory", true);
         }
      }

我在自己虚拟机上时候, 都很正常, 这个问题是在换机器后出现...

论坛徽章:
1
技术图书徽章
日期:2013-12-05 23:25:45
6 [报告]
发表于 2006-06-14 11:37 |只看该作者
if (is_dir($v)) {
修改为:
  echo realpath($v);
  if (is_dir($v)) {

论坛徽章:
0
7 [报告]
发表于 2006-06-14 16:33 |只看该作者
谢谢版主, 在class.rFastTemplate.php中第146行的var $WIN32 = true 改为false就行, 因为我装在linux上面, 这样就不用对服务器进行判断了
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP