Tutorial: Installing Zend Optimizer on OS X

If you use your Mac to develop web applications with PHP, or if you need to install third party PHP scripts, chances are you'll eventually need to install the Zend Optimizer. If your PHP application has been encoded by the Zend Encoder or the Zend SafeGuard Suite, the Zend Optimizer is needed before they will run.

Luckily, it's pretty easy to install, though you will have to venture into the command line using the Terminal app. No worries, though; I'll walk you through it.

First, download the Zend Optimizer. Be sure to get the Mac OSX version. If you haven't already, you'll need to register and log in to the Zend web site. Expand the downloaded file (I used Stuffit Expander) to a directory on your hard drive. I put mine on the Desktop -- I'll be deleting it once I'm done.

Next, open up the Terminal application.

If you've never changed any PHP configuration settings before, you'll need to make sure you have a copy of the php.ini file. Type:

ls /etc/php.ini

If it responsd with "ls: /etc/php.ini: No such file or directory", then you need a copy of php.ini. Type:

sudo cp /etc/php.ini.default /etc/php.ini

You'll have to enter your password, since "sudo" runs the copy command as root. If the file already exists, you don't need to copy anything. Now change directory to your newly expanded folder, and run the install script:

cd /Users/username/Desktop/ZendOptimizer-2.5.10-darwin6.8-ppc
sudo ./install.sh

This will start an interactive install program inside the Terminal window. Use the tab and return keys to navigate. Read and accept the Zend Optimizer's license.

The first thing you're asked is where to install the Zend Optimizer. I accepted the default, "/usr/local/Zend", because /usr/local/ is the standard place to install additional Unix applications.

Next, it will ask the location of your php.ini file. If you followed the steps above, enter "/etc" in this box. The install script will make some changes to this file, but you shouldn't need to worry about it.

When the script asks, "Are you using the Apache web server?" answer Yes. It will ask for the full path to the Apache control utility, which should be correct by default: "/usr/sbin/apachectl".

Now just continue through the prompts until the install script finishes. Answer yes when prompted to "restart the web server now". If you don't restart now, you will need to restart manually before you can user the Zend Optimizer. If you need to restart manually, in the Terminal, type:

sudo apachectl restart

That's it! You now have Zend Optimizer installed, and you will be available to your PHP applications. Please drop a comment here if this is useful for you, or if you have any trouble at all, and I'll try to give you a hand.

by frank on Jul 5, 05 12:27 PM

Trackback Pings

TrackBack URL for this entry:
http://www.macpot.com/cgi-local/mt/mt-tb.cgi/64