Pear on Mac OS X Leopard

The newest version of Snow Leopard has PEAR but the last version of Leopard (10.5.x) did not come with PEAR. As a web developer I use PHP with PEAR. This is how I got it working with just a few commands.

I found that is it easiest to navigate to the location where the files need to be like this
cd /usr

Then if it isn't already created. Make a local folder
mkdir local
cd /usr/local

Now download the PEAR from the php.net
curl http://pear.php.net/go-pear > go-pear.php
sudo php -q go-pear.php

While it was installing I left everything default not changing to typing anything. On the last part where it wanted to change the php.ini file I said no, do not alter. Below are the directions for changing it.
PHP changes
By default Mac OS X has a php.ini.default file which is best to make a copy
cd /etc
cp php.ini.default php.ini

Now edit the file.
nano php.ini

NOTE: I used the CTRL+W in nano to find the "include_path". I then added to the path.
.:/usr/local/PEAR

Now you need to restart Apache. Also you can check to make sure that PEAR is working by typing the following
which pear

If you get back something then you will have successfully installed PEAR.

Comments

Popular posts from this blog

Console over SSH (ONTAP)

Brocade Zone Setup

OpenSolaris ZFS Setup