PHP Hints

June 29, 2011

Pear on XAMPP

Filed under: Doctrine ORM,PEAR,XAMPP — kkruecke @ 1:24 pm
Tags: , , , ,

These are the steps I following to get the pear command line utility pear.bat working under xampp for windows.

1. I downloaded the 7z–zipped version of xampp for windows and unzipped it to c:\xampp.

2. I installed the cygwin linux command line utilties for windows.

3. I ran the cygwin “as Administrator” (right click the Cygwin desktop icon and select “run as administrator”).

4. I changed the permissions of the c:\xampp directory to 777

# cd /cygdrive/c
# chmod -R 777 xampp

5. Set the PEAR configuration settings for data_dir, test_dir and doc_dir. For example,

# cd /cygdrive/c/xampp/php
# mkdir pear/data
# ./pear.bat config-set data_dir c:\\xampp\\php\\pear\\data

Do this for data_dir, test_dir, doc_dir, and cfg_dir as necessary. You will need to create the respective directories first (as shown above for data_dir). Note the use of double slashes! Also note: You may need to do the chmod -R 777 again after the config-sets, to make the subdirectories read/write-able.

To see the current PEAR configuration do

# cd /cygdrive/c/xampp/php
# ./pear.bat config-show

after running Cygwin as Administrator.

6. Now install the packages you want. For example, this is how you would install Doctrine 2 ORM. Again, I am doing this from the Cygwin shell.

# cd /cygdrive/c/xampp/php
# ./pear.bat channel-discover pear.doctrine-project.org
# ./pear.bat install pear.doctrine-project.org/DoctrineORM

If you want to update current packages:

# cd /cygdrive/c/xampp/php
# ./pear.bat update-channels
# ./pear.bat upgrade-all

Advertisement

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Theme: Rubric. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.