[請益] 使用smarty時,include檔案出現問題

看板PHP作者時間19年前 (2006/08/17 02:05), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/2 (看更多)
目前我的環境有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
文章代碼(AID): #14urvYn4 (PHP)
文章代碼(AID): #14urvYn4 (PHP)