2012-01-28 74 views
0

m使用wamp和zend框架。首先我安裝了wamp localhost,然後運行正常。 已下載Zend框架。 在windows的環境變量中增加了php路徑,zend庫路徑。 啓用重寫模塊,並在php.ini中設置包含路徑 ,我在phpinfo文件中得到正確。 在此之後米試圖在控制檯上此命令後,執行zend framework zf命令不起作用

zf create project FirstProject 

我得到一個錯誤

In order to run the zf command, you need to ensure that Zend Framework 
is inside your include_path. There are a variety of ways that you can 
ensure that this zf command line tool knows where the Zend Framework 
library is on your system, but not all of them can be described here. 

The easiest way to get the zf command running is to give it the include 
path via an environment variable ZEND_TOOL_INCLUDE_PATH or 
ZEND_TOOL_INCLUDE_PATH_PREPEND with the proper include path to use, 
then run the command "zf --setup". This command is designed to create 
a storage location for your user, as well as create the zf.ini file 
that the zf command will consult in order to run properly on your 
system. 

To change the setup of this tool, run: "zf --setup" 

感謝UR提前幫助。

回答

2

我知道你說過你已經添加了php和庫路徑,但是如果你可以再次確定你的環境變量是正確設置的,那將是很棒的。

注意:這是zend工具正常工作所需的bin目錄。

如果在此之後仍然不工作,請讓我知道,我們可以從那裏開始。

變量名稱:應設置爲

Path 

和變量值:中應包含

C:\Zend\ZendServer\share\ZendFramework\bin; 

您的鏈接的鏈接可能是不同的,因爲我安裝了Zend服務器在不同的默認的位置,框架可通過'share'目錄獲得。

確保您放入的鏈接指向zf.bat(在Windows系統上 - 我相信您使用WAMP)的目錄,您應該能夠從命令提示符下測試它的工作情況只使用zf命令。

要進入GUI,你可以更新環境變量:

1) Right click on the Computer icon on your Desktop and choose Properties option. 
2) In the System window click on Advanced system settings in the left pane 
3) In the System Properties window select Advanced tab and click on Environment Variables 
4) In the Environment Variables window you will notice two columns - User variables for a username and System variables 
5) In the System variables section scroll down to 'Path' and then highlight it and click 'Edit' 
6) At the end of the last entry place a ; character and then paste the path to the ZendFramework\bin on your system like above 

希望這有助於

戴夫

+0

thnks for your help。 – 2012-01-28 13:21:36

+0

不用擔心; --D,它工作嗎? – dkcwd 2012-01-28 13:24:23

+0

只是一個問題,我沒有Zend服務器。我只有Zend Framework和zf.bat文件路徑被添加到環境變量中,但它仍然會給出錯誤。我早些時候安裝了Zend Server,但刪除了之後是否需要安裝Zend Server? coz m遵循Zend Framework初學者指南中的說明n他們已經在命令行中請求zend框架 – 2012-01-28 13:27:44

1

您收到此消息意味着其找到ZF工具的事實在垃圾桶裏就好了。它的zend庫文件的位置沒有找到。您必須將解壓目錄中的/ library/Zend中的/ Zend文件夾複製到某個位置。首選的方法是將/ Zend文件夾直接複製到你的php/includes文件夾中,並且這種方式甚至不需要向你的php.ini include_path參數添加任何東西,或者你至少必須取消它的評論。所以在你移動目錄之後,你會看到/ php/includes/Zend和include_path將會是'c:\ php \ includes'

1

「所以在你移動目錄後,你會看到/ php/includes/Zend和include_path將是'c:\ php \ includes'「

我不是一個PHP專業開發人員,但我會在上面給出的Andy解釋的好解釋中說過,你應該小心地將include_path設置爲'c :\ php \ includes',而不是'c:\ php \ includes \ Zend',因爲我認爲,直到我測試出從路徑中取出'Zend'時才工作......希望這是有用的。乾杯。

0

試試這個簡單的方法:

第1步:在Program Files目錄下,並將其命名ZendFrameworkCli創建一個文件夾。

C:\Program Files\ZendFrameworkCli 

第2步:副本binlibrary從Zend框架文件,並貼到上面提到的目錄中。

SEPT 3:設置進入系統設置環境變量的路徑。 對於PHP,它將是C:\wamp\bin\php\php5.3.5; 並使用來自客戶端的Zend C:\Program Files\ZendFrameworkCli\bin;