2012-06-19 69 views
0

目前我正在嘗試安裝Zend Framework。該框架附帶一個命令行工具,用於* nix系統的zf.sh以及用於Windows系統的zf.bat。要使用zf.sh,我試圖將其添加到我的環境路徑中。不知何故,我無法讓它工作。將文件夾添加到環境變量

~/.profile

export PATH=$PATH:/Applications/MAMP/bin/php/php5.3.6/bin/ 

export ZEND=/Applications/MAMP/bin/php/php5.3.6/bin/zf.sh 

# 2012-06-05 make alias for zf 
# Make an alias for the zf.sh so we can call it with zf instead of zf.sh 
alias zf=/Applications/MAMP/bin/php/php5.3.6/bin/zf.sh 

# Add the path to the Zend files so that the zf.sh can work with them 
ZEND_TOOL_INCLUDE_PATH=/Applications/MAMP/bin/php/php5.3.6/lib/php/Zend 

/etc/paths

/usr/bin 
/bin 
/usr/sbin 
/sbin 
/usr/local/bin 
~/Development/play-2.0 
/Applications/Racket\ v5.2/bin/ 
/Applications/MAMP/bin/php/php5.3.6/bin/ 

但是當我做echo $PATH

/usr/bin /bin /usr/sbin /sbin /usr/local/bin /usr/X11R6/bin 

或者zf

fish: Unknown command 'zf' 

回答

1

添加alias zf='/var/www/zf1_trunk/bin/zf.sh'.bash_profile應該讓你如果使用MAMP訪問ZF命令行

at ~/.bash_profile 
alias zf='/var/www/zf1_trunk/bin/zf.sh' 
+0

但我必須將該行更改爲zf.sh的右側位置?所以在我的情況下,在'.bash_profile'中,'alias zf ='/ Applications/MAMP/bin/php/php5.3.6/bin/zf.sh'' – wowpatrick

0

通常,OSX上的bash使用.bash_profile,而不是.profile ...查看它是否正確地採集它。

+0

我改變了文件名的形式'.profile'到'.bash_profile',但它似乎仍然沒有工作! – wowpatrick

+0

爲什麼您的PATH顯示空格而不是:s –

+0

哪裏不應該有空格? – wowpatrick

1

在MAC OS X

  1. 打開終端
  2. 在終端類型「VI的.bash_profile 「
  3. 在編輯器中輸入行

別名ZF = '/應用/ MAMP/bin中/ PHP/php5.3.6/bin中/ zf.sh'

變化位置ACC。你的軟件安裝

  1. 退出終端
  2. 打開終端,然後鍵入ZF
相關問題