简体   繁体   中英

Setting up Zend Framework CLI tool on OS X 10.7 Lion

I have been fighting to set up Zend Framework's CLI tool on OS X for ages. I have followed the manual , but I can't get it to work.

The most common setup in the *nix environment, is to copy the zf.sh and zf.php into the same directory as your PHP binary.

[...]

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.

When I do this, it says /usr/bin/php . So, I have put zf.sh and zf.php into /usr/bin .

Now, the next step is where I get really confused.

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 something like /usr/lib/php, /usr/share/php, /usr/local/lib/php, or similar), ensure that the contents of the /library/ directory are put inside your include_path specified directory.

Running php -i | grep include_path php -i | grep include_path returns include_path => .: => .: , which I am not really sure what means (I am new to *nix). I have tried to copy the contents of the library folder to /usr/share/php/ , but without luck.

So I guess my problem is figuring out where my include path is so I can put the contents of the library folder there. I figured I would find my php.ini. When I run phpinfo() from a script, it says that my php.ini is located at /etc , but there is no php.ini in that folder. Also, executing php -i shows the following:

Configuration File (php.ini) Path => /etc
Loaded Configuration File => (none)

I guess my PHP is running with default settings since no config file is loaded. I am testing from the terminal with zf show version and get -bash: zf: command not found .

I am really, really confused!

I had similar problems once. If i remember correctly i was using WAMP and it had multiple php.ini files (3 i think), i had to track down the right one.

i followed this tutorial and it worked for me http://akrabat.com/wp-content/uploads/Getting-Started-with-Zend-Framework.pdf

hope it helps

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM