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.hHas anyone had a similar experience ?
I'm on a M开发者_运维技巧BP running 10.6.5 & php 5.3.3.
Thanks
To install the pecl_http extension on Mac OS 10.8 (using MAMP):
- Install brew
- Install autoconf using brew
brew install autoconf
- Download the source code for PHP 5.4.10 (or whatever version you are using) from php.net
- Extract the source code into /Applications/MAMP/bin/php/php5.4.10/include
- Rename the extracted file from "php-5.4.10" to "php"
- Run ./configure in the newly created "php" folder
- Add extension=http.so to my php.ini file
- Restart MAMP
After that I was able to install Pecl extensions without any problems.
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
精彩评论