Install Pecl On Mac

If your PEAR installation is an old version (earlier than 1.4.0) that is provided by your operating system's package manager or your 'website package' (e.g. XAMPP), then you need to read this 1 to successfully upgrade your PEAR installation to where it can install/upgrade packages from PEAR's pear.php.net channel. Downloading PECL extensions. There are several options for downloading PECL extensions, such as: The pecl install extname command downloads the extensions code automatically, so in this case there is no need for a separate download. Install PHP and PECL on Mac. $ sudo pecl install protobuf-3.4.0 After protobuf extension is installed, Update php.ini by adding this line to your php.ini file. Install intl pecl extension on MAMP Mac OS 10.8.2. GitHub Gist: instantly share code, notes, and snippets.

MAMP is an easy to install set of tools for that provides a great local development environment for Mac users (Mac Apache MySQL PHP). OS X does ship with its own built in versions of these tools, but MAMP adds lots of goodies. The newest version of MAMP includes a graphical configuration tool, a choice of PHP versions, web-based tools for administering your databases, and a variety of useful PHP extensions.

Unfortunately, MAMP doesn’t include everything. If you’re developing a site that needs additional PHP extensions like the Memcached library or exotic database drivers, you’ll need to use the PEAR and PECL tools to build and install them. PECL (PHP Extension Community Library) and PEAR (PHP Extension and Application Repository) both provide access to a large pool of useful PHP add-ons, but using them with MAMP requires you to do a bit of extra configuration. In this article, you’ll learn how to get them running on the latest version of MAMP (2.x).

INSTALLING COMPONENTS

The usual method for installing PEAR and PECL components is via the command line. Here is an example for installing PHPUnit.

2
$echo'export PATH=/Applications/MAMP/bin/php/php5.3.6/bin:$PATH'>>~/.profile


Now you can either restart your terminal session or run the following from your home directory to read in the new path variable.

2
$../.profile


You should now have the correct binaries on your path and can check this by running the „which“ command again.

2
4
6
8
10
$pear channel-discover pear.drush.org
Discovery of channel'pear.drush.org'succeeded
$pear install drush/drush
Starting todownload drush-4.5.0.tgz(281,392bytes)
.........................................................done:281,392bytes


Hurray! Good times.

Install Pecl On Mac Windows 10

PECL

For PECL to work we need to prepare the build environment for extensions by making the PHP source available. Download the MAMP Server components and libraries zip file and make yourself a cup of tea whilst you wait. Perhaps have a biscuit as well, I recommend the classic custard cream. You’ll also need to have Xcode installed to get Autotools.

Once it’s downloaded, find the zip file corresponding to your version of PHP, extract it into a new directory in your PHP installation and run the configure script.

2
4
6
8
10
$pecl install uploadprogress
.
Build process completed successfully
Installing'/Applications/MAMP/bin/php/php5.3.6/lib/php/extensions/no-debug-non-zts-20090626/uploadprogress.so'
install ok:channel://pecl.php.net/uploadprogress-1.0.3.1
configuration option'php_ini'isnotset tophp.ini location
You should add'extension=uploadprogress.so'tophp.ini


You can now have some upload progress goodness by editing your php.ini file (in this case /Applications/MAMP/bin/php/php5.3.6/conf/php.ini) and restarting the MAMP servers.

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

Configure and Install PEAR

You should now be at a prompt to configure PEAR.

  1. Type 1 and press return.

  2. Enter: /hp-c4780-installation-software-mac.html.

  3. Type 4 and press return.

  4. Enter:

  5. Press return

Verify PEAR

You should be able to type:

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

Install Pecl On Mac Virtualbox

Find this interesting? Let's continue the conversation on Twitter.

Comments are closed.