2011-03-08 40 views
0

我下載並將最新版本的Zend Framework解壓到OSX(10.6)(我也用XAMPP運行web服務器,但我將include_path更改添加到XAMPP和OSX路徑中,但這是所有命令行我不認爲php編譯器使用XAMPP安裝)Zend OSX和一個「。」添加到上下文路徑

我嘗試創建一個項目,並得到以下內容:(注意,我只是爲了隱私而用「----」替換部分路徑)

sh-3.2# zf create project testProject

Fatal error: Uncaught exception 'Zend_Exception' with message 'File "Zend/Tool/Project/Context/Zf/./AbstractClassFile.php" does not exist or class "Zend_Tool_Project_Context_Zf_._AbstractClassFile" was not found in the file' in /Volumes/----/----/z/library/Zend/Loader.php:99 Stack trace:

0 /Volumes/----/----/z/library/Zend/Tool/Project/Context/Repository.php(88): Zend_Loader::loadClass('Zend_Tool_Proje...')

1 /Volumes/----/----/z/library/Zend/Tool/Project/Context/Repository.php(79): Zend_Tool_Project_Context_Repository->addContextClass('Zend_Tool_Proje...')

2 /Volumes/----/----/z/library/Zend/Tool/Project/Provider/Abstract.php(87): Zend_Tool_Project_Context_Repository->addContextsFromDirectory('/Volumes/----/...', 'Zend_Tool_Proje...')

3 /Volumes/----/----/z/library/Zend/Tool/Framework/Provider/Repository.php(187): Zend_Tool_Project_Provider_Abstract->initialize()

4 /Volumes/----/----/z/library/Zend/Tool/Framework/Client/Abstract.php(128): Zend_Tool_F in /Volumes/----/----/z/library/Zend/Loader.php on line 99 sh-3.2#

注意月經後 「Context_Zf_」

我已經收窄,道指n至的代碼塊:

文件:/Volumes/----/----/z/library/Zend/Tool/Project/Provider/Abstract.php

public function initialize() 
{ 
    // initialize the ZF Contexts (only once per php request) 
    if (!self::$_isInitialized) { 

     // load all base contexts ONCE 
     $contextRegistry = Zend_Tool_Project_Context_Repository::getInstance(); 
     $contextRegistry->addContextsFromDirectory(
      dirname(dirname(__FILE__)) . '/Context/Zf/', 'Zend_Tool_Project_Context_Zf_' 
     ); 
     $contextRegistry->addContextsFromDirectory(
      dirname(dirname(__FILE__)) . '/Context/Filesystem/', 'Zend_Tool_Project_Context_Filesystem_' 
     ); 
     // determine if there are project specfic providers ONCE 

具體地說「 dirname(dirname(FILE))「正在回顯爲」。「

,如果我換塊用 '如果{...}(目錄名(目錄名(__ FILE))!= 「」)',然後我不明白的錯誤,但我得到另:

sh-3.2# zf create project testProject

An Error Has Occurred
Context by name applicationDirectory does not exist in the registry.

Zend Framework Command Line Console Tool v1.11.3 Details for action "Create" and provider "Project"
Project zf create project path name-of-profile file-of-profile

回答

0

我在我的Mac上測試過,效果很好。你有沒有嘗試重新啓動你的xampp服務器,我真的不知道它是如何工作的,因爲我使用Apache & PHP已經安裝了不是「AMP包」的版本。也許這是php.ini的include_path還沒有被重新加載的問題。

這顯然與路徑的問題,因爲它沒有成功打造的類名:

"Zend/Tool/Project/Context/Zf/./AbstractClassFile.php" 

點不應該出現在這裏。 你可以從你的php.ini分享你的PATH變量和你的include_path變量。

+0

奇怪的是,我找不到要更改的正確的php.ini文件。我現在已經改變了其中的5個,沒有任何改變。我正在運行XAMPP,但正在使用終端來運行zf命令。 '哪個php'和'php -i | grep php.ini'都顯示了我的XAMPP安裝之外的東西。我認爲現在最好的選擇是殺死xampp,也許嘗試本地安裝Zend服務器。 – Mondo 2011-03-08 20:26:25