7
votes

I am trying to install pecl_http in MAMP php. I am getting the following errors.

grep: /Applications/MAMP/bin/php/php5.5.10/include/php/main/php.h: No such file or directory
grep: /Applications/MAMP/bin/php/php5.5.10/include/php/Zend/zend_modules.h: No such file or directory
grep: /Applications/MAMP/bin/php/php5.5.10/include/php/Zend/zend_extensions.h: No such file or directory
Configuring for:

Did a research on that and found out we need MAMP server components and Libraries.

After downloading this component, find the zip file corresponding to my version of PHP, extract it into a new directory in your PHP installation and run the configure script.

All the posts I saw points to this link http://www.mamp.info/en/downloads/ . But I cant find anything there. And in few other links I found the components for older versions php (till 5.3).

This installation depend on too many things and takes a lot of time. Please let me know, if any one know where can I find these MAMP SERVER components and Libraries for PHP5.5.10

Attaching most of the output lines created in my terminal FYI.

$ sudo pecl install pecl_http
Password:
downloading pecl_http-2.0.6.tgz ...
Starting to download pecl_http-2.0.6.tgz (152,827 bytes)
......................done: 152,827 bytes
downloading raphf-1.0.4.tgz ...
Starting to download raphf-1.0.4.tgz (7,232 bytes)
...done: 7,232 bytes downloading propro-1.0.0.tgz ...
Starting to download propro-1.0.0.tgz (6,217 bytes)
...done: 6,217 bytes 4 source files, building WARNING: php_bin /Applications/MAMP/bin/php/php5.5.10/bin/php appears to have a suffix /php5.5.10/bin/php, but config variable php_suffix does not match
running: phpize grep: /Applications/MAMP/bin/php/php5.5.10/include/php/main/php.h: No such file or directory
grep: /Applications/MAMP/bin/php/php5.5.10/include/php/Zend/zend_modules.h: No such file or directory
grep: /Applications/MAMP/bin/php/php5.5.10/include/php/Zend/zend_extensions.h: No such file or directory
Configuring for:
PHP Api Version: Zend Module Api No: Zend Extension Api No: whether to enable raphf support [yes] : yes building in /usr/local/pear/pear-build-rootXNkOc5/raphf-1.0.4 running: /usr/local/pear/raphf/configure --enable-raphf=yes checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking for a sed that does not truncate output... /usr/bin/sed checking for cc... cc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether cc accepts -g... yes checking for cc option to accept ISO C89... none needed checking how to run the C preprocessor... cc -E checking for icc... no checking for suncc... no checking whether cc understands -c and -o together... yes checking for system library directory... lib checking if compiler supports -R... no checking if compiler supports -Wl,-rpath,... yes checking build system type... x86_64-apple-darwin12.5.0 checking host system type... x86_64-apple-darwin12.5.0 checking target system type... x86_64-apple-darwin12.5.0 checking for PHP prefix... /Applications/MAMP/bin/php/php5.5.10 checking for PHP includes... -I/Applications/MAMP/bin/php/php5.5.10/include/php -I/Applications/MAMP/bin/php/php5.5.10/include/php/main -I/Applications/MAMP/bin/php/php5.5.10/include/php/TSRM -I/Applications/MAMP/bin/php/php5.5.10/include/php/Zend -I/Applications/MAMP/bin/php/php5.5.10/include/php/ext -I/Applications/MAMP/bin/php/php5.5.10/include/php/ext/date/lib checking for PHP extension directory... /Applications/MAMP/bin/php/php5.5.10/lib/php/extensions/no-debug-non-zts-20121212 checking for PHP installed headers prefix... /Applications/MAMP/bin/php/php5.5.10/include/php checking if debug is enabled... no checking if zts is enabled... no checking for re2c... no configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers. checking for gawk... no checking for nawk... no checking for awk... awk checking if awk is broken... no checking whether to enable raphf support... yes, shared checking for ld used by cc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... no
...............
^
1 error generated.
make: *** [php_propro.lo] Error 1
ERROR: `make' failed
64 source files, building

1 error generated.
make: *** [php_http_buffer.lo] Error 1
ERROR: `make' failed

3

3 Answers

11
votes

Got few tips from some existing posts related to this kind of issues. I found the component for php5.5.10 in http://us2.php.net/get/php-5.5.10.tar.gz/from/a/mirror

Followed the steps below to install pecl_http on my MAMP on Mac OS 10.8:

Install brew
Install autoconf using brew brew install autoconf
Download the source code for PHP 5.5.10 (or whatever version you are using) from php.net
Extract the source code into /Applications/MAMP/bin/php/php5.5.10/include
Rename the extracted file from "php-5.5.10" to "php"
cd /Applications/MAMP/bin/php/php5.5.10/include/php
Run ./configure
Add extension=http.so to my php.ini file
Restart MAMP

All my extensions are installed.

Special thanks to joshua.paling and user387049 for all the above information.

0
votes

I struggled with the same as well. Installing was a pain because MAMP libraries are no longer publicly available. But once I got what the library components was expected to do as well, it was actually relatively simple.

You can simply download the latest php version here -: http://php.net/releases/index.php, extract it's content and insert it content below.

The path looks like this for me /Applications/MAMP/bin/php/php5.5.3/include/php . I manually create the folder include, and then the extracted download content here in the php folder.

After that ./configure worked, and then I just did pecl install uploadprogress. Add that extension to the relevant php.ini file (for the version) -: extensions=uploadprogress.so into your php.ini

Cheers Pratik

0
votes

I've got this running with MAMP 3.2.1 on OS X 10.10.5 Yosemite. Here's the commands I ran:

download the php source code: http://us2.php.net/get/php-5.6.7.tar.bz2/from/a/mirror

go to the downloads folder

cd ~/Downloads

extract the tarball

tar -xzvf ./php-5.6.7.tar.bz2

rename the resulting folder to php:

mv php-5.6.7 php

move it

mv php /Applications/MAMP/bin/php/php5.6.7/include/

install the Xcode command line tools:

xcode-select --install

run configure and build something!

cd /Applications/MAMP/bin/php/php5.6.7/include/php
./configure
pecl install uploadprogress

Thanks to:

Can't phpize or configure an extension in OS X 10.9 Mavericks

and

How to fix, 'PHP' make, in Mac OS X (10.9.4)?