Re: [請益] zend 初始設定
※ 引述《hsnucsc (hsnugo)》之銘言:
: 我依照3897篇的教學
: 設定了zend framework
: 可以run
: 但是我試著把include path的那三行註解掉
: 並把php.ini的include_path改成下面這樣
: ; Windows: "\path1;\path2"
: include_path = ".;C:\AppServ\www\zf-tutorial\library"
: 他卻說
: Warning: require_once(Zend/Loader.php) [function.require-once]: failed to
: open stream: No such file or directory in
: C:\AppServ\www\zf-tutorial\public\index.php on line 12
: Fatal error: require_once() [function.require]: Failed opening required
: 'Zend/Loader.php' (include_path='.;C:\php5\pear') in
: C:\AppServ\www\zf-tutorial\public\index.php on line 12
看錯誤訊息是找不到ZF的位置,還是你改完php.ini後忘了restart Apache :)
我再簡單說明一下我的安裝流程好了
Step1. 去ZF官網下載壓縮檔,.zip或.gz的都ok,目前是1.5.2版
Step2. 解壓縮
然後會在裡面看到幾個資料夾
demos/
library/
tests/
還有一些其它的版權跟讀我檔,這裡你需要的,就是library裡的東西而已
其它demos跟tests的東西用不上,不過也可以研究看看 :)
Step3. 設定ZF的目錄
我的環境是WinXP + AppServ,在這裡我把library裡的Zend資料夾整個剪過去放在
C:\AppServ\php5\classes\
於是在原來的目錄底下就會變成:
C:\AppServ\php5\classes\Zend
(其實也不一定要放離開www的資料夾啦,隨個人習慣)
然後調一下php.ini的設定(如果你沒權限改它的話,就用我原來index.php裡的方法囉
; Windows: "\path1;\path2"
include_path = ".;C:\AppServ\php5\classes" <--這是我的php.ini設定
注意在include_path裡並沒有"Zend" :)
改完,存檔,reload || restart Apache!
以上,供你參考 :)
: //Basic Config
: error_reporting(E_ALL | E_STRICT); //設定Error Report的等級
: date_default_timezone_set('Asia/Taipei'); //設定時區為台北
: //Include path
: define ('P_S', PATH_SEPARATOR);
: set_include_path('.' .P_S .'../library' .P_S .'../application/models/'
: .P_S
: .get_include_path());
: //漏了這兩行 :)
: require_once 'Zend/Loader.php';
: Zend_Loader::registerAutoload();
: //Controller
: $frontController = Zend_Controller_Front::getInstance();
: $frontController->setControllerDirectory('../application/controllers');
: $frontController->dispatch();
: ?>
--
http://blog.eddie.com.tw/
http://www.eddie.com.tw/
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.132.128.37
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):
PHP 近期熱門文章
PTT數位生活區 即時熱門文章