错误:undefined function include()

Amy-zhang 2007-03-21 03:54:59
main.php
<?php
include_once("class/Smarty.class.php"); //包含smarty类文件

$smarty = new Smarty(); //建立smarty实例对象$smarty
$smarty->template_dir ="/.templates/";//设置模板目录
$smarty->compile_dir ="/.templates_c/"; //设置编译目录
$smarty->config_dir = "/.configs/";

$smarty->left_delimiter = "{";
$smarty->right_delimiter = "}";

test.php
<?php
  include('main.php');
//  $smarty->assign('title', '测试用的网页标题');
//  $smarty->assign('content', '测试用的网页容');
//  $smarty->display('test.htm');
?>

在上面的两个页面,main.php未抛错,而test.php抛以下错误
Fatal error: Call to undefined function   include() in D:\webRoot\testPro2\test.php on line 2
这会是什么原因呢?


?>

...全文
155 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
ffb 2007-12-22
  • 打赏
  • 举报
回复
我也碰到类似的问题,怎么解决的啊
Amy-zhang 2007-03-21
  • 打赏
  • 举报
回复
恩,现在可以了,谢谢啊
van_glm 2007-03-21
  • 打赏
  • 举报
回复
检查main文件
mynamesucks 2007-03-21
  • 打赏
  • 举报
回复
是不是include前面有非法字符?
因为你的报错信息里的include前面都有一快空白

21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧