briangallagher
briangallagher

Reputation: 539

OS X installing pecl_http

I'm trying to install php HTTP extension but I'm getting the following error during installation :

checking for magic.h... not found
configure: error: could not find magic.h

Has anyone had a similar experience ?

I'm on a MBP running 10.6.5 & php 5.3.3.

Thanks

Upvotes: 0

Views: 3888

Answers (2)

4F2E4A2E
4F2E4A2E

Reputation: 2183

CFLAGS="-arch i386" ./pecl install

or

sudo CFLAGS="-arch i386" /Applications/MAMP/bin/php5.3/bin/pecl install pecl_http

See: OS X 10.6 (Snow Leopard) – using MAMP/PECL to install PHP extensions

Upvotes: 2

user387049
user387049

Reputation: 6857

To install the pecl_http extension on Mac OS 10.8 (using MAMP):

  1. Install brew
  2. Install autoconf using brew brew install autoconf
  3. Download the source code for PHP 5.4.10 (or whatever version you are using) from php.net
  4. Extract the source code into /Applications/MAMP/bin/php/php5.4.10/include
  5. Rename the extracted file from "php-5.4.10" to "php"
  6. Run ./configure in the newly created "php" folder
  7. Add extension=http.so to my php.ini file
  8. Restart MAMP

After that I was able to install Pecl extensions without any problems.

Upvotes: 2

Related Questions