开发者

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 M开发者_运维技巧BP running 10.6.5 & php 5.3.3.

Thanks


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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜