Installing Zend Framework on MAMP
As usual, I’m sharing a solution a problem that I personally encountered and couldn’t find a great solution for. So I’ve been using my laptop more and more as my local development environment in order to keep things private and secure while in the dev stage. Among learning how to fully utilize SVN locally, I’ve been trying to setup my laptop to be a fully functional server while also being extremely easy to maintain and change my environment on the fly. To do this, I’m running MAMP (Mac Apache MySQL PHP) available for free at mamp.info as well as the Zend Framework bundled with Zend Tool.
- Get MAMP up and running, no special setup is needed here.
- Download Zend Framework and place it wherever you’d like. I actually retrieved my copy via SVN so that I can easily upgrade it later. To do this open up terminal and follow these commands:
cd /Applications/MAMP/ mkdir svn cd svn mkdir zendframework cd zendframework svn checkout http://framework.zend.com/svn/framework/standard/trunk
- Now open your php.ini file located under /Applications/MAMP/conf/php5/php.ini
- Search for include_path (around line 411 on mine) and add the location of your zend framework:
include_path = ".:/usr/lib/php:/usr/local/lib/php:/Applications/MAMP/svn/zendframework/trunk/library"
Make sure to include the library directory otherwise you’ll get a blank page in Zend Framework
- Zend Framework also comes with a shell script that will help you with RAD (Rapid Application Deployment), you can create a shortcut to Zend Tools in terminal by adding an alias to your profile under /etc/profile (thanks DS for pointing this out) and make sure to restart terminal after you’ve done so:
alias zf=/Applications/MAMP/svn/zendframework/trunk/bin/zf.sh
- Test if the Zend Tool is installed correctly by showing the version:
zf show version
- Finally navigate to the directory you’d like to create your first project in:
cd /Applications/MAMP/htdocs/
and with Zend Tool creating a project is simple:
zf create project test

