views:

65

answers:

2

I have been going through this page to install zend framework on my machine locally.

http://framework.zend.com/manual/en/zend.tool.framework.clitool.html

I can't get it recognize the command in my terminal "zf show version", it keeps coming back to me with command not found. I do have xampp installed on this machine and everytime I run the command "which php" it brings up my xampp folder and when I run php-i|grep include_path it brings up the include path from xampp. I can go to the Zend Server on my browser and see the include path, install path, etc. /usr/local/zend/share/ZendFramework..I can see where zf.php and zf.sh are. I have the proper libraries installed. I just want to be able to access my zf from the command line and it's not allowing me to. Is this because of xampp? I'm really confused. This is my first post on stack overflow :-)

A: 

My first Zend project was kind of a pain to get running. After a while of trying to get the simlink (symbolic link) to work. I ended out navigating to the folder where I want to setup my project and got the zf.sh running by entering the whole path

cd /var/www/
and then
/usr/local/zend/share/ZendFramework/bin/zf.sh create project project Name

or something like that

Jeff
Okay I can access the command line console by typing the entire path and then the command I want to enter. For example /usr/local/zend/share/ZendFramework/bin/zf.sh show version...but what if I want to just type zf show version at any directory and that have info show up. Where would I set that up at?
wowzuzz
For that you need to create a symbolic link http://en.wikipedia.org/wiki/Symbolic_link which will act like a command line shortcut
Jeff
Okay so I created a symbolic link with the link to the file with a new name "zf" but its telling me ln: zf: Permission denied
wowzuzz
Have you tried with sudo zf ? it looks like you are on a linux system, this might be the right way.
Jeff
Ok, the sudo worked for me. I see the symbolic link that was created, but zf show version is still not working in my terminal. Do I have to set this up in the bashrc file?
wowzuzz
I got it working by adding an alias to my bashrc file. So what was the purpose of having a symbolic link? Thanks for the help!
wowzuzz
For the bashrc file i really don't know since I'm a new linux user, i mostly do my dev on a windows machine
Jeff
I'm new as well, so all the little bits help
wowzuzz
A: 

I got this working by going to my bashrc file located in the root. So in the terminal type cd /.. to the root and then type cd /etc. Just open that bashrc file and add an alias... alias zf='zf.sh', then do source bashrc in your terminal and you should be setup. Basically what I learned here is that any shortcut that you want to have instead of the long path, you have to make an alias for it in the bashrc file in order for it to work in the terminal. Maybe there is another way, but this is what worked for me

wowzuzz