作者nsxbaby ()
看板PHP
标题[请益] 使用smarty时,include档案出现问题
时间Thu Aug 17 02:05:39 2006
目前我的环境有index.php与main.php以及三个资料夹class、libs、user
class资料夹中有template.php档案
libs资料夹中有smarty资料夹(包含了smarty要用的档案与资料夹)
user资料夹中有个register.php
index.php会先include('main.php');
main.php会include资料夹class中的template.php
当我用index.php来include('main.php');可以正常运作
但是当我要在register.php中include('../main.php');时会出问题
错误讯息:
Warning: main(../WEB/libs/smarty/Smarty.class.php): failed to open stream: No such file or directory in c:\appserv\www\WEB\class\template.php on line 2
Fatal error: main(): Failed opening required '../WEB/libs/smarty/Smarty.class.php' (include_path='.;c:\php4\pear') in c:\appserv\www\WEB\class\template.php on line 2
template.php之中用了reauire_once
require_once ('../WEB/libs/smarty/Smarty.class.php');
请问为什麽我在index.php引入main.php的时候,main.php可以require_once('class/Template.php');
而在register.php中引入main.php,main.php却会出问题呢?
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 218.168.201.104