Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 182895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T15:01:14+00:00 2026-05-11T15:01:14+00:00

I’m ultimately trying to install PEAR so I can easily install PHPUnit. I want

  • 0

I’m ultimately trying to install PEAR so I can easily install PHPUnit. I want to set up a Mac, Apache, MySQL, PHP, PHPUnit development environment so I can test locally. I already have Apach, MySQL and PHP working. Now all I need is PHPUnit, which means I need PEAR to install it.

I have searched all over, and there are a few variations of ‘the tutorial’ on how to install PEAR on Mac OS X 10.5. However, I can’t seem to get any of them to work! Has anyone had success with this? I’m not totally confident that I have everything set up as it should be, so if you could include the ‘default’ Mac OS X 10.5 include paths, or a simple explanation of where everything should go, I would appreciate it.

Following this tutorial I do the following:

curl http://pear.php.net/go-pear > go-pear.php sudo php -q go-pear.php 

I press enter until I get to a list with 7 include paths:

1. Installation prefix ($prefix) : /Users/andrew 2. Temporary files directory     : $prefix/temp 3. Binaries directory            : $prefix/bin 4. PHP code directory ($php_dir) : $prefix/PEAR 5. Documentation base directory  : $php_dir/docs 6. Data base directory           : $php_dir/data 7. Tests base directory          : $php_dir/tests 

I change the Installation prefix to be /usr/local, press enter to continue, type Y to also install PEAR_Frontend_Web-beta, PEAR_Frontend_Gtk2, MDB2. Eventually, everything is installed.

Next…

On the first try, I think include_path was commented out of the php.ini file, but since I’ve already changed this line, and this is not the first time I’ve tried installing, I get the following message:

WARNING!  The include_path defined in the currently used php.ini does not contain the PEAR PHP directory you just specified: </usr/local/PEAR> If the specified directory is also not in the include_path used by your scripts, you will have problems getting any PEAR packages working.  Would you like to alter php.ini </private/etc/php.ini>? [Y/n] :  

I type Y and let pear automatically update my include path:

php.ini </private/etc/php.ini> include_path updated.  Current include path           : .:/usr/share/pear Configured directory           : /usr/local/PEAR Currently used php.ini (guess) : /private/etc/php.ini 

I press enter to continue, and get the following message:

The 'pear' command is now at your service at /usr/local/bin/pear  ** The 'pear' command is not currently in your PATH, so you need to ** use '/usr/local/bin/pear' until you have added ** '/usr/local/bin' to your PATH environment variable.  Run it without parameters to see the available actions, try 'pear list' to see what packages are installed, or 'pear help' for help.  For more information about PEAR, see:    http://pear.php.net/faq.php   http://pear.php.net/manual/  Thanks for using go-pear!  PHP Warning:  rmdir(/usr/local/temp): Not a directory in /Users/andrew/go-pear.php on line 1237  Warning: rmdir(/usr/local/temp): Not a directory in /Users/andrew/go-pear.php on line 1237 

Update: I think I know why these last two warnings came up. Previously, I tried to fix the temp directory problem by creating a symbolic link to /tmp but if I understand correctly, PEAR is trying to create its own temp directory for installation, then it’s going to delete it when it’s finished. So I should not have created this symbolic link since it’s going to try to delete the temp directory when the installation has finished.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T15:01:15+00:00Added an answer on May 11, 2026 at 3:01 pm

    There’s a few things that could be going wrong here, these are only guesses.

    First, there’s two include paths you’ll need to worry about. The first is your PHP include path. PEAR libraries are (mostly) just PHP code, specially packaged up. When you install a PEAR module you’re downloading all the PHP code needed for that library, and any other PEAR libraries the library you’re installing rely on (sorry about that sentence, but I’m not sure there’s a better way to say that). This include path is set in your php.ini files (one file for your command line php, another for yoru web server php; often the same file).

    The second include path you’ll need to worry about is your UNIX/shell include path. This is the path that your computer will search for commands in when you enter a command from a terminal. The ‘pear’ command is a command line command.

    So, we need to make sure that

    1. The php.ini file for your website has the PEAR directory in its include path
    2. The php.ini file for your command line php application has the PEAR directory in its include path
    3. Your shell application (terminal, likely BASH in you’re on OS X) has the PEAR directory in its include path

    So, for number 1, put a PHP page on your server that include the function call

    phpinfo(); 

    This will list a bunch of information about your server. Look for the location of php.ini. Open this file in a text editor, look for the include_path variable, and add the path to your PEAR directory (don’t remove the other paths, just add yours).

    For number 2, run the following from your command line

    php -r 'phpinfo();' | grep '.ini' 

    A bunch of lines will print out, look for the one that reads something like ‘Loaded Configuration File’. Open this file in a text editor, look for the include_path variable, and add the path to your PEAR directory (don’t remove the other paths, just add yours).

    Finally, and this is what I think your problem is, we need to ensure that the pear command line command is in your shell/bash path. That’s what this error is refering to

    ** The 'pear' command is not currently in your PATH, so you need to 

    There should be a file in your home directory named ‘.bash_profile’. It’s a hidden file, so it won’t showup in the Finder. Open it with a text editor. If you’re having trouble because this is a hidden file, use the command line pico editor. Ctrl-X will save from pico

    cd ~ pico .bash_profile 

    This file gets executed by your shell everytime you open a terminal window. We’re going to add /usr/local/bin to your PATH, which means when you attempt to run a command, yoru computer will search for the command in this folder. Add the following line to the bottom of .bash_profile

    export PATH=/usr/local/bin:$PATH 

    This is, more or less, equivilant to the following PHP code

    $PATH = '/usr/local/bin:'.$PATH 

    You’re adding /usr/local/bin as the first colon-delimited place to look for command, and then adding the rest of the existing path to it. Once you’ve added that line, close your terminal, re-open it, and then type

    pear 

    This should give you a list of valid pear commands, but more importantly will let you know pear is in your path.

    Good luck!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am trying to loop through a bunch of documents I have to put
I have a bunch of posts stored in text files formatted in yaml/textile (from
We're building an app, our first using Rails 3, and we're having to build
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I'm making a simple page using Google Maps API 3. My first. One marker
I have some data like this: 1 2 3 4 5 9 2 6

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.