Install PEAR and PECL on Mac OS X 10.8

February 16th, 2013 0 Comments

The following instructions install PEAR and PECL on Mac OS X under /usr/local/. PECL is bundled with PEAR. So this is as simple as installing PEAR on Mac OS X.

PEAR is PHP’s Package Repository and makes it easy to download and install PHP tools like PHPUnit and XDebug. I specifically recommend these two for every PHP developer.

Download PEAR

curl -O
sudo php -d detect_unicode=0 go-pear.phar

Configure and Install PEAR

You should now be at a prompt to configure PEAR.

Type 1 and press return.

(location of installation)

Type 4 and press return.

Press return

Verify PEAR

You should be able to type:

pear version

Eventually, if you use any extensions or applications from PEAR, you may need to update PHP’s include path.

Everything You Wanted To Know About Zend Server CE for Mac OSX 10.7 Lion

August 17th, 2011 0 Comments

Zend Server CE is one of the best stacks available for development, and for Mac OSX. These are some simple instructions to get you up and running quickly (and you may learn a few things along the way as well).

Hint: You can copy-paste in terminal so just copy-paste when you can to save yourself time.

Step 1: Download
+ Download Zend Server CE for OSX from (I recommend the PHP 5.3 version)
+ Follow the prompts and install to the default locations

Step 2: .bash_profile Updates
Let’s edit the bash_profile so you can access the controls from the terminal much easier.

+ Open Terminal
+ Type Open .bash_profile
+ Copy-paste the following


+ Save file (close)

While were making changes, let’s shortcut Zend Framework too so you can access easily in Terminal to create new projects:

+ Open Terminal
+ alias zf=/usr/local/zend/share/ZendFramework/bin/

+ Now restart your computer for the changes to take effect.

Step 3. Welcome Back!… Let’s Change Localhost Port
The Apache in Zend Server is configured for localhost to use port 10088. Let’s make your life easy and change this.

+ Open Terminal
+ sudo stop
+ sudo vi /usr/local/zend/apache2/conf/httpd.conf
+ Arrow down to line that says Listen 10088 and type the letter i
+ Change to Listen 80
+ Esc, then save/exit by typing :x

+ sudo vi /usr/local/zend/apache2/bin/apachectl
+ Arrow down to line that says STATUSURL=”http://localhost:10088/server-status” and type the letter i
+ Change to STATUSURL=”http://localhost:80/server-status”
+ Esc, then save/exit by typing :x

+ sudo start

Step 4. Change root passwords for MySQL / phpmyadmin
Do not login to phpmyadmin until you have changed root password!
By default, Zend Server CE doesn’t setup a password for root access to MySQL. Although this is likely a development environment, this is a security issue. Let’s change the root password.
+ Open Terminal
mysql -u root
mysql> UPDATE mysql.user SET Password=PASSWORD(‘NEW_PASSWORD’) WHERE User=’root’;
mysql> flush privileges;
mysql> quit

Step 5. Change Server Root To Sites Folder
Although it’s easy enough to create a shortcut to your htdocs folder, it’s also just as easy to change the root folder. The Sites folder is the standard location used on OSX, and is a convenient place for your projects.
+ Open Terminal
+ sudo vi /usr/local/zend/apache2/conf/httpd.conf
+ Arrow down to the following line and type i to start editing:
change DocumentRoot “/usr/local/zend/apache2/htdocs”
to DocumentRoot “/Users/COMPUTER_ACCOUNT_USERNAME/Sites”
+ Arrow down to the following line to start editing:
change <Directory "/usr/local/zend/apache2/htdocs"></code>
to <Directory "/Users/COMPUTER_ACCOUNT_USERNAME/Sites">
+ Esc, then save/exit by typing :x

Step 6. PEAR and PHPUnit
Let’s upgrade PEAR and install PHPUnit

+ Open Terminal
+ Type the following one line at a time:
sudo pear update-channels
sudo pear upgrade-all
sudo pear channel-discover
sudo pear channel-discover
sudo pear channel-discover
sudo pear install phpunit/PHPUnit

Step 7. date.timezone
Don’t forget to date.timezone for PHP. You can do this in the php.ini file, however, Zend Server CE makes this very easy to do from the control panel. Simply launch the control panel, agree to Terms of Use and other basics.
+ Select Server Setup
+ Select Directives
+ Select Date
+ Add America/New_York to input field
+ Save and restart PHP

From Terminal:
Start: sudo start
Stop: sudo stop
Restart: sudo restart
Zend Framework: zf (see list of controls to create projects, files, etc.)
PHPUnit: phpunit

And at any point if you need to uninstall Zend Server CE for some reason, it’s simple to do:
+ Open Terminal
+ sudo /usr/local/zend/bin/

And you can always try a nice alternative called MAMP which you can download at, but remember, it doesn’t have all of the features that are found with Zend Server CE (but everything most people need for LAMP development).

Happy Programming with Zend Server CE
Note: These instructions will work with OSX 10.6 as well.