php pecl install mac os x 10.6

20
2014-03
  • Chris Muench

    Does anyone know how to install pecl for mac os x 10.6. I have tried googling with no luck.

  • Answers
  • emcconville

    PECL should ship with PHP on OSX 10.6. If not, it may be a part if the development libraries packaged with OSX's install disc. You can identify if it's installed by typing the following in your Terminal.app (should return a path).

    which pecl
    

    If your unable to find PECL

    Sometimes it's easier to re-install PHP. Look into macports, or homebrew. Both package managers ship the latest PHP5 (including PECL).

    Verify PECL is working

    Updated your local database with the latest packages, and install a simple package (like bbcode.)

    sudo pecl channel-update pecl.php.net
    sudo pecl install bbcode
    

    Install a PECL package without PECL

    This is hit-n-miss depending on the package. To install a PECL package manully, you would follow the traditional ./configure, make, and make install process.

    # Download the package
    curl -O http://pecl.php.net/get/bbcode-1.0.3b1.tgz
    # Extract archive
    tar zvxf bbcode-1.0.3b1.tgz
    # Change directory
    cd bbcode-1.0.3b1
    # Apply local php settings
    phpize
    # Run configuration script
    ./configure
    # Compile
    make
    # Verify build
    make test
    # Install on system
    sudo make install
    

  • Related Question

    osx - php's pecl - oauth - Mac OS X 10.6.6
  • alexus

    I'm trying to install a php extension through pecl and I'm getting some weird errors... any ideas?

    wcmisdpilotpc1:~ alexus$ sudo pecl install oauth
    Password:
    
    Notice: Array to string conversion in PEAR/REST/10.php on line 85
    
    Warning: Invalid argument supplied for foreach() in PEAR/REST/10.php on line 88
    
    Warning: Invalid argument supplied for foreach() in /usr/lib/php/PEAR/REST/10.php on line 88
    
    Fatal error: Cannot use string offset as an array in /usr/lib/php/PEAR/REST/10.php on line 256
    wcmisdpilotpc1:~ alexus$ 
    

  • Related Answers
  • Josh K

    You are getting PHP errors, and I believe those are coming directly from PEAR itself, not the extension you are trying to download.

    You could always try installing the extension manually.