[請益] 使用smarty時,include檔案出現問題
目前我的環境有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
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 2 篇):
PHP 近期熱門文章
PTT數位生活區 即時熱門文章