Postcards From My Life

Lint I find in my mind's belly-button.
  • EPK
  • Consulting
  • Resume
  • Nerd Herding
  • Talks
  • Flex
  • Zend Framework
« Dynamically loading images from the web in Flex 3
97 Things Every Programmer Should Know »

How I got Zend_Tool working on Windows

Dear Reader,

I love Zend Framework. I love it so much I wrote the very first book about Zend Framework. (Note: It’s no longer the best Zend Framework book, but still, it’s a good one) I’ve written projects using it and I now find myself teaching another class on it. One of the cool things about Zend Framework is it’s cli tool, Zend_Tool. (zf) When zf works, it’s awesome. However, when it breaks, it’s a real pain in the butt. Thanks to buddies like Ralph Schindler though (the author of the tool) when it does break, I can usually get help getting it back up and running.

The latest version of zf that comes with Zend Framework 1.10.x and better is much better than previous version and it shows that Zend (well, at least Ralph) listens when people point out problems and work to solve them.

Even though it’s made great strides, setting up zf is still not seamless. To that end, here is my list of steps needed to setup zf.

My setup

I should note before I start that I am running Windows 7. This means symlinking stuff is right out and we have to resort to physically copying files around. On top of Windows 7, I’m running XAMPP. (anyone know, is that pronounced X-AMP ot ZAMP?) this means that my PHP sits in \xampp\php. I’ve added that directory to my WIndows path so I can execute php from any cmd window. With that understanding, here’s my list.

The steps

  1. Download Zend Framework and unpack it somewhere on your harddrive where you want it to live.
  2. Make sure php.exe is in your PATH and make sure you know where php.exe is.
  3. Find the bin directory in your Zend Framework directory. In it there are 2 files, zf.bat (or zf.sh for Linux) and zf.php. Copy those to the same directory php.exe is in. (Linux users, feel free to just symlink them)
  4. Your Zend Framework directory should contain a library directory, change directory into it.
  5. from the library directory, test your zf to make sure it works, zf show should give you what you need.
  6. Type zf --setup storage-directory On Windows 7, this will create a directory named .zf in c:\Users\<Your Profile Name>
  7. Type zf --setup config-file. On WIndows 7, this will create a file .zf.ini in c:\Users<Your Profile Name>
  8. Using your favorite text editor, open c:\Users\<Your Profile Name>\.zf.ini. There should only be a single line in it that contains the include_path zf will use. Add the full path to your Zend Framework directory here. It should end in “\library\”.

Test it

That’s all there is to getting it setup. (I remember the days when it took twice as long and required cursing just to get it working) To test it out, cd to any directory other than the Zend Framework directory and type zf show version That should give you the current version of the framework you have installed.

Now you are free to start using it to create projects, etc.

Small problem

There is still a problem with defining your own providers. I tried to add my twitter provider (yes, I can use zf to tweet!) and it won’t yet recognize it. I’ve brought this to Ralph’s attention and impressed upon him the importance of being to tweet from zf. I have no doubt that a solution will be forthcoming.
UPDATE
As pointed out in the comments, this has been fixed, just not documented. This page shows how to add your own providers either manually or via a command.

You can either manually add a line to your .zf.ini

basicloader.classes.0 = "My_ClassName"

or you can use zf to update itself

zf enable config.provider class-name

So now I can tweet from zf again. :)

Until next time,
I <3 |<
=C=

[Disclaimer: I use to work at Zend and still have great friends there like the lovely Nili and the walking ray of sunshine that is Andrea. That having been said, it's been a long time since they gave me any money. So the point of this disclaimer is really just so I can mention Nili and Andrea. :) ]

Related posts

  • Things I learned about Zend Tool (9)
  • Quickie Zend Framework Bootstrap Note (3)
  • php|architect’s Guide to Programming the Zend Framework (8)

Tags: andrea, cli, nili, PHP, ralph shindler, zend framework, zend_tool

This entry was posted on Tuesday, February 23rd, 2010 at 7:30 am and is filed under PHP, Programming. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

10 Responses to “How I got Zend_Tool working on Windows”

  1. Elizabeth M Smith Says:
    February 23rd, 2010 at 7:34 am

    Or you could just use the VC9 builds of PHP 5.3+ with Windows 7 – and have symlinking in PHP

    And use symlinks on Windows 7 and Vista … sigh

    http://www.howtogeek.com/howto/windows-vista/using-symlinks-in-windows-vista/

  2. Cal Evans Says:
    February 23rd, 2010 at 7:44 am

    Good morning Liz!

    Symlinking in PHP wouldn’t do me much good in this case. (At least that I can see)

    Yes, I could have used mklink, I knew about this because I think you pointed it out to me at a conference after I went on a rant about no symlinks in Windows. I just don’t like it. In my particular case, since I updave ZF from svn, yeah, it would be easier for me to symlink but in most cases, I don’t think it’s any easier than just unzip and copy the files to the proper location.

    Thanks for stopping by! :)

    =C=

  3. 7paul Says:
    February 23rd, 2010 at 8:03 am

    BasicLoader is now in user, just look here: http://framework.zend.com/issues/browse/ZF-8899

  4. Jeremy Brown (notmessenger) Says:
    February 23rd, 2010 at 8:59 am

    You could also use the ‘doskey’ command in Windows, using something such as: doskey zf=C:\ZENDF~1.10\bin\zf.bat

  5. Cal Evans’ Blog: How I got Zend_Tool working on Windows | Webs Developer Says:
    February 24th, 2010 at 9:02 am

    [...] systems, but has some quirks about it on Windows. To help with the situation, Cal Evans has posted a guide on Zend_Tool and how he got it working on his Windows 7 platform. One of the cool things about Zend Framework [...]

  6. Pierre Says:
    February 24th, 2010 at 9:35 am

    hi,

    Copying the files all over is usually a bad idea, especially when a given app/lib/module will be updated regulary.

    As Liz pointed out, you could use symbolic on vista or later. Or, even better, simply add the ZF bin directory to your PATH.

  7. How to get Zend_Tool working under Windows 7 « PHP Libraries, API's and Frameworks Says:
    February 25th, 2010 at 9:30 am

    [...] http://blog.calevans.com/2010/02/23/how-i-got-zend_tool-working-on-windows/ [...]

  8. Cristiano Says:
    February 25th, 2010 at 9:31 am

    Great Resource. Thanks man.

  9. abcphp.com Says:
    March 1st, 2010 at 11:05 am

    How I got Zend_Tool working on Windows | Postcards From My Life…

    I love Zend Framework. I love it so much I wrote the very first book about Zend Framework. (Note: It’s no longer the best Zend Framework book, but still, it’s a good one) I’ve written projects using it and I now find myself teaching another class on it…

  10. Zend Framework News » Blog Archive » Zend_Tool unter Windows zum Laufen bekommen Says:
    March 13th, 2010 at 9:06 am

    [...] http://blog.calevans.com/2010/02/23/how-i-got-zend_tool-working-on-windows/ [...]

  • Event Registration Online for Day Camp 4 Developers : Soft Skills

  • Team Based PHP Training

  • Tags

    adobe API article Cal Evans codeworks community conference cw09 Derick Rethans developers devzone elizabeth naramore Exim flex fun IBuildings Kathy Evans linkedin Management Marketing microsoft MySQL Nashville open source phar PHP phparchitect php developers podcampnashville podcast Programming Quickies respect Sebastian Bergmann Silly-Con Valley sixty second tech software development terry chay twitter upgrade video windows wordpress zend zend framework

  • RSS PHP Podcasts

    • JSClasses, JSMag, PHP Alpha 1, PHP strict typing, IndieConf – Lately in PHP podcast episode 4
    • SitePoint Podcast #76: Wicked WordPress Themes with Allan Cole and Jeffrey Way
    • DPCRadio: Designing for Reusability
    • SitePoint Podcast #75: Awesome Overkill
    • DPCRadio: Technical Debt
    • SitePoint Podcast #74: WordPress Themes with Nathan Rice and Cory Miller
    • SitePoint Podcast #73: Cease and Desoup
    • DPCRadio: APC & Memcache the High Performance Duo
    • APC & Memcache the High Performance Duo
    • SitePoint Podcast #72: Web Video and Social Media with Gregory Ng and Wayne Sutton

  • Me

    • Best web design company
    • Cal Evans Dot Com
    • Cheap Wine Diary
    • Cyrano’s Apprentice
    • Evans Internet Construction Company
    • My Life as a Child
    • PHP Podcasts
    • Sixty Second Tech

  • Categories

    • Apache
    • BlogBling
    • Blogging
    • codeworks
    • Entertainment
    • Entrepreneurship
    • Flex
    • Humor
    • JavaScript
    • Long Form
    • Management
    • Marketing
    • Me
    • PHP
    • podcasting
    • Programming
    • SQL
    • Technology
    • Web 2.0
    • wordpress
    • WordPress Plugins
    • writing
    • zend framework


Postcards From My Life is proudly powered by WordPress
Entries (RSS) and Comments (RSS).