Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
In a previous video, I described how to install and configure the Zend Framework into your PHP installation on Windows using WAMP server. In this video I'll describe how to do the same thing on MacOS X with MAMP. I'll assume that you're working with MAMP in its default configuration with the MAMP folder under Applications. If you have access to the Exercise Files that come with the course, you'll find a copy of the Zend Framework in the 03 managing code folder under Exercise Files. If you don't have access to those files, you can download Zend Framework from the Zend Framework website website at framework.zend.com/download/latest.
Look for the Zend Framework minimal package. Click the free download link and follow the prompts. You can place the Zend Framework anywhere on your Mac hard disk. I typically copy it under the MAMP installation folder. So I'll do that in these steps. I have an alias to my MAMP folder here. It's under /Applications/MAMP. I'll go back to the 03 managing code folder and copy the Zend Framework to the Clipboard. Then go to the MAMP folder and paste it in.
The next step is to include the Zend Framework files in your PHP configuration. You do this by modifying the PHP.ini file. You'll need to be sure which version of PHP. ini is being used by your PHP installation. To do that, go to MAMP and click Open start page. From there click on phpInfo at the top. The phpInfo page will show you which PHP.ini is being used under Loaded Configuration File.
My PHP.ini is under / applications/MAMP/conf/PHP 5.3/PHP.ini. I'll navigate to that folder in Finder. I'll start at my Mac hard disk root and go down to Applications , then MAMP, con, PHP 5.3, and here's the INI file I need to modify.
You can open this with any text editor. Once you've opened PHP.ini, search for the string include_path. Working in Text Edit I've pressed Command+F, typed an include_path and then clicked Next, and I'll find that the first instance of that string is in a comment. I'll click Next again and this takes me to the actual setting. This is the default setting in the PHP.INI file provided with MAMP. It includes a dot, meaning the current directory of the currently executing PHP file, Then the paths are separated from each other or with a colon.
In Windows, it's a semicolon. The following path refers to an area where you might add files in your MAMP installation. In fact, it refers to a directory that doesn't actually exist, but I'm going to keep it in that string and then add the correct path from my Zend Framework installation. I'll place the cursor after the current path and before the closing quote, then put in a colon, and then the path, / applications/MAMP/ZendFramework/library.
Make sure you type it exactly as I'm showing here. It is case sensitive. Save and close your PHP. ini file and return to MAMP. Click the Stop Servers button to close down your servers. If necessary, type in your administrator password, and then once the servers gave shut down, click Start Servers to start them up again. The Zend Framework classes should now be available to your PHP runtime environment and as I'll show in subsequent videos, you'll be able to include and execute the classes where ever you need them in your PHP-based website.
Get unlimited access to all courses for just $25/month.Become a member