The most common setup in the *nix environment, is to copy the
zf.php into the same directory
as your PHP binary. This can generally be found in one of the
/usr/bin /usr/local/bin /usr/local/ZendServer/bin/ /Applications/ZendServer/bin/
To find out the location of your PHP binary, you can execute 'which php' on the command line. This will return the location of the PHP binary you will be using to run PHP scripts in this environment.
The next order of business is to ensure that Zend Framework
library is set up correctly inside of the system PHP
include_path. To find out where your
include_path is located, you can execute php -i
and look for the include_path variable, or more succinctly,
execute php -i | grep include_path. Once you have found where
your include_path is located (this will generally be
/usr/local/lib/php, or similar), ensure that the contents of the
/library/ directory are put
inside your include_path specified directory.
Once you have done those two things, you should be able to issue a command and get back the proper response like this:
If you do not see this type of output, go back and check your setup to ensure you have all of the necessary pieces in the proper place.
There are a couple of alternative setups you might want to employ depending on your servers configuration, your level of access, or for other reasons.
Alternative Setup involves keeping the Zend
Framework download together as is, and creating a link from a
location to the
zf.sh. What this means is you can
place the contents of the ZendFramework download into a location
/usr/local/share/ZendFramework, or more locally
/home/username/lib/ZendFramework, and creating a
symbolic link to the
Assuming you want to put the link inside
(this could also work for placing the link inside
/home/username/bin/ for example) you would issue a
command similar to this:
ln -s /usr/local/share/ZendFramework/bin/zf.sh /usr/local/bin/zf # OR (for example) ln -s /home/username/lib/ZendFramework/bin/zf.sh /home/username/bin/zf
This will create a link which you should be able to access globally on the command line.