Updating MAMP to PHP 5.4.8 - php

I used this guide How do you upgrade MAMP's PHP to PHP 5.3 ? to update my PHP-Version on MAMP but it does not work.
I'm not sure if I did everything right.
I downloaded php 5.4.8 und put the folder into MAMP -> conf and renamed it to php5.4.8 to make it even with the other PHP Folders in there. Than I followed the guide, but got the following error:
Binarys-MacBook-Air:~ BinaryCoder$ cd /Applications/MAMP/conf/php5.4.8
Binarys-MacBook-Air:php5.4.8 BinaryCoder$ ./configure --with-mysql=/Applications/MAMP/Library --with-apxs2=/Applications/MAMP/Library/bin/apxs --with-gd --with-jpeg-dir=/Applications/MAMP/Library --with-png-dir=/Applications/MAMP/Library --with-zlib --with-freetype-dir=/Applications/MAMP/Library --prefix=/Applications/MAMP/bin/php/php5.4.4 --exec-prefix=/Applications/MAMP/bin/php/php5.4.4 --sysconfdir=/Applications/MAMP/bin/php/php5.4.4/conf --with-config-file-path=/Applications/MAMP/bin/php/php5.4.4/conf --enable-ftp --enable-gd-native-ttf --with-bz2=/usr --with-ldap --with-mysqli=/Applications/MAMP/Library/bin/mysql_config --with-t1lib=/Applications/MAMP/Library --enable-mbstring=all --with-curl=/Applications/MAMP/Library --enable-sockets --enable-bcmath --with-imap=shared,/Applications/MAMP/Library/lib/imap-2007f --enable-soap --with-kerberos --enable-calendar --with-pgsql=shared,/Applications/MAMP/Library/pg --enable-exif --with-libxml-dir=/Applications/MAMP/Library --with-gettext=shared,/Applications/MAMP/Library --with-xsl=/Applications/MAMP/Library --with-pdo-mysql=/Applications/MAMP/Library --with-pdo-pgsql=shared,/Applications/MAMP/Library/pg --with-mcrypt=shared,/Applications/MAMP/Library --with-openssl --enable-zip --with-iconv=/Applications/MAMP/Library --without-iconv
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 build system type... i386-apple-darwin12.2.0
checking host system type... i386-apple-darwin12.2.0
checking target system type... i386-apple-darwin12.2.0
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 how to run the C preprocessor... cc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking whether ln -s works... yes
checking for system library directory... lib
checking whether to enable runpaths... yes
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking for gawk... no
checking for nawk... no
checking for awk... awk
checking if awk is broken... no
checking for bison... bison -y
checking for bison version... 2.3 (ok)
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking whether to enable computed goto gcc extension with re2c... no
checking whether cc supports -no-cpp-precomp... yes
checking whether to force non-PIC code in shared modules... no
checking whether /dev/urandom exists... yes
checking for pthreads_cflags...
checking for pthreads_lib...
Configuring SAPI modules
checking for AOLserver support... no
checking for Apache 1.x module support via DSO through APXS... no
checking for Apache 1.x module support... no
checking whether to enable Apache charset compatibility option... no
checking for Apache 2.0 filter-module support via DSO through APXS... no
checking for Apache 2.0 handler-module support via DSO through APXS...
Sorry, I cannot run apxs. Possible reasons follow:
1. Perl is not installed
2. apxs was not found. Try to pass the path using --with-apxs2=/path/to/apxs
3. Apache was not built using --enable-so (the apxs usage page is displayed)
The output of /Applications/MAMP/Library/bin/apxs follows:
cannot open /Applications/MAMP/Library/build/config_vars.mk: No such file or directory at /Applications/MAMP/Library/bin/apxs line 217.
configure: error: Aborting
Binarys-MacBook-Air:php5.4.8 BinaryCoder$
What was my misstake?
Thank you!

MAMP only supports the following
Programs and libraries:
Apache HTTP Server 2.2.22
PHP 5.2.17
PHP 5.3.14 (MAMP PRO only)
PHP 5.4.4
MySQL 5.5.25
phpMyAdmin 3.5.1
SQLiteManager 1.2.4
Alternative PHP Cache (APC) 3.1.9
curl 7.24.0
eAccelerator 0.9.6.1
Expat XML Parser 2.0.1
FreeType 2.4.8
gettext 0.18.1.1
jpeg 8d
libiconv 1.14
Libidn 1.17
libmcrypt 2.6.8
libpng 1.5.7
libxml2 2.7.8
libxslt 1.1.26
Sablotron XML processor 1.0.3
t1lib 5.1.2
XCache 1.2.2
XCache 1.3.2
Xdebug 2.2.0
PHP/YAZ 1.0.14
YAZ 4.0.1
This update is already available on download page, here php 5.4.8 is not available

Related

Cannot find OpenSSL's <evp.h> when installing mysqlnd on PHP 7.0.13

I'm getting the following error when trying to install mysqlnd extension on PHP 7.0.13.
My openssl files are located on /usr/include/openssl/ according to locate evp.h.
Already tried these:
--with-openssl=/usr/include/openssl/
--with-openssl-dir=/usr/include/openssl/
Installing libssl-dev
https://github.com/mongodb/mongo-php-driver/issues/138
configure: error: Cannot find OpenSSL's <evp.h>
Still getting the same error.
./configure
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /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-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /root/.phpbrew/php/php-7.0.13
checking for PHP includes... -I/root/.phpbrew/php/php-7.0.13/include/php -I/root/.phpbrew/php/php-7.0.13/include/php/main -I/root/.phpbrew/php/php-7.0.13/include/php/TSRM -I/root/.phpbrew/php/php-7.0.13/include/php/Zend -I/root/.phpbrew/php/php-7.0.13/include/php/ext -I/root/.phpbrew/php/php-7.0.13/include/php/ext/date/lib
checking for PHP extension directory... /root/.phpbrew/php/php-7.0.13/lib/php/extensions/no-debug-non-zts-20151012
checking for PHP installed headers prefix... /root/.phpbrew/php/php-7.0.13/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... gawk
checking whether to enable mysqlnd... yes, shared
checking whether to disable compressed protocol support in mysqlnd... yes
checking for the location of libz... no
checking for DSA_get_default_method in -lssl... no
checking for X509_free in -lcrypto... yes
checking for pkg-config... /usr/bin/pkg-config
UPDATE
Found an entry on bugs.php.net describing a problem with mysqlnd's configure file, maybe this could be related.
For anyone having this (or similar) problem here are some of my findings installing PHP 7.1 on Ubuntu 17.04 using phpbrew.
I tried to install php-7.1 using phpbrew as follows:
phpbrew install 7.1 +default
This fails reporting that is unable to find Openssl library, some github issues and forums suggest using the following instead:
phpbrew install 7.1 +default +mysql +openssl=/usr/local/openssl/
Which also fails with the exact same error message as the original question:
Cannot find OpenSSL's <evp.h>
In fact the file can be found in /usr/local/openssl making the situation even more strange.
I Finally found solution as suggested in a phpbrew issue 111:
phpbrew install 7.1 +default +openssl=shared -- --with-openssl-dir=/usr/include/openssl
Notice that +openssl now says shared and --with-openssl-dir is used to indicate the same path as before /usr/include/openssl

Trouble Installing libsodium on Centos 6

I'm running CENTOS 6.7 and Apache and PHP 5.4.x. I'm using the EPEL and REMI repositories. I'm trying to install the libsodium extension.
It is my understanding that I need to install libsodium first, then the extension. Based on Googling, to get the right version, I ended on:
yum --enablerepo=remi install php54-php-pecl-libsodium
and I get the following result:
Installed:
php54-php-pecl-libsodium.x86_64 0:1.0.5-1.el6.remi
Dependency Installed:
audit-libs-python.x86_64 0:2.3.7-5.el6
environment-modules.x86_64 0:3.2.10-2.el6
libcgroup.x86_64 0:0.40.rc1-17.el6_7
libselinux-python.x86_64 0:2.0.94-5.8.el6
libsemanage-python.x86_64 0:2.0.43-5.1.el6
php54-php-common.x86_64 0:5.4.45-7.el6.remi
php54-runtime.x86_64 0:2.1-4.el6.remi
policycoreutils-python.x86_64 0:2.0.83-24.el6
setools-libs.x86_64 0:3.3.7-4.el6
setools-libs-python.x86_64 0:3.3.7-4.el6
tcl.x86_64 1:8.5.7-6.el6
Then I type in:
pecl install libsodium
and I get:
[root#core3 tmp]# pecl install libsodium
downloading libsodium-1.0.5.tgz ...
Starting to download libsodium-1.0.5.tgz (169,801 bytes)
.....................................done: 169,801 bytes
9 source files, building
running: phpize
Configuring for:
PHP Api Version: 20100412
Zend Module Api No: 20100525
Zend Extension Api No: 220100525
building in /var/tmp/pear-build-rootAHK93D/libsodium-1.0.5
running: /var/tmp/libsodium/configure --with-php-config=/usr/bin/php-config
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
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-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib
checking for PHP extension directory... /usr/lib64/php/modules
checking for PHP installed headers prefix... /usr/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... re2c
checking for re2c version... 0.13.5 (ok)
checking for gawk... gawk
checking for libsodium support... yes, shared
checking for libsodium files in default path... not found
configure: error: Please install libsodium - See https://github.com/jedisct1/libsodium
ERROR: `/var/tmp/libsodium/configure --with-php-config=/usr/bin/php-config' failed
You can see the error seems to indicate that libsodium is not installed when it is. Am I missing a step?
php54-php-pecl-libsodium is a SCL package (for parallel installation).
You probably need php-pecl-libsodium.
yum --enablerepo=remi install php-pecl-libsodium
You don't need to run the "pecl install comand".
It's been a while since I've installed a PECL module, but I believe that running the initial command would have taken care of installing the module, no need to run pecl manually after that.
Indeed, we can see that the file list from rpm shows the module installed along with a php.ini file to include it.
$ rpm -qlp http://rpms.famillecollet.com/store/php54/php/pecl/libsodium/1.0.5/php54-php-pecl-libsodium-1.0.5-1.el6.remi.x86_64.rpm
/opt/remi/php54/root/etc/php.d/libsodium.ini
/opt/remi/php54/root/usr/lib64/php/modules/libsodium.so
/opt/remi/php54/root/usr/share/doc/pecl/libsodium
/opt/remi/php54/root/usr/share/doc/pecl/libsodium/LICENSE
/opt/remi/php54/root/usr/share/doc/pecl/libsodium/README.md
/opt/remi/php54/root/var/lib/pear/pkgxml/php54-php-pecl-libsodium.xml
Did you make sure to restart your web server?

Error installing PDFlib

after much searching and testing classes and libraries that would generate a PDF from a html, give up and left to use PDFlib, by speaking it is more worked, but at least I know I must support the community.
But I'm stuck at the beginning.
I give the following command to install
pecl install pdflib
and it is giving error at the end:
downloading pdflib-3.0.4.tgz ...
Starting to download pdflib-3.0.4.tgz (27,043 bytes)
.........done: 27,043 bytes
7 source files, building
running: phpize
Configuring for:
PHP Api Version: 20121113
Zend Module Api No: 20121212
Zend Extension Api No: 220121212
path to pdflib installation? : /var/www/html/wordpress/wp-content/plugins/all-plugins-necessary
building in /tmp/pear/temp/pear-build-rootqJIDAR/pdflib-3.0.4
running: /tmp/pear/temp/pdflib/configure --with-pdflib=/var/www/html/wordpress/wp-content/plugins/all-plugins-necessary
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /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-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib
checking for PHP extension directory... /usr/lib/php5/20121212
checking for PHP installed headers prefix... /usr/include/php5
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... gawk
checking for PDFlib support... yes, shared
checking for g++... no
checking for c++... no
checking for gpp... no
checking for aCC... no
checking for CC... no
checking for cxx... no
checking for cc++... no
checking for cl.exe... no
checking for FCC... no
checking for KCC... no
checking for RCC... no
checking for xlC_r... no
checking for xlC... no
checking whether we are using the GNU C++ compiler... no
checking whether g++ accepts -g... no
checking how to run the C++ preprocessor... /lib/cpp
configure: error: in `/tmp/pear/temp/pear-build-rootqJIDAR/pdflib-3.0.4':
configure: error: C++ preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details
ERROR: `/tmp/pear/temp/pdflib/configure --with-pdflib=/var/www/html/wordpress/wp-content/plugins/all-plugins-necessary' failed
Can anyone help me telling what lack I install or configure?
EDIT:
As Chris said in the comments, it does indicate you do not have a c compiler installed.
sudo apt-get install g++
If it still doesn't work after installing g++, then try the below steps.
You may need to install the specific PHP PDFlib version downloaded directly from their site, then install via pecl.
http://www.pdflib.com/download/pdflib-family/pdflib-9/
Someone else resolved the problem this way, see the following post for full setup instructions:
PDF Lib install fail on linux server. Using pecl install pdflib

Mac10.11 install php memcached in Xammp

My development environment is Mac 10.11.1,XAMPP for OS X 5.6.12.
I want to install memcached for XAMMP refer to http://wiki.cerbweb.com/Setup:Development/XAMPP/Mac_OS_X#zlib :
Memcache
- sudo /Applications/XAMPP/xamppfiles/bin/pecl install memcache
- 'Yes' when prompted
- stop and start Apache from XAMPP Control Panel.app
- Confirm memcache extension in http://localhost/xampp/phpinfo.php
but when I run sudo /Applications/XAMPP/xamppfiles/bin/pecl install memcache
It like that:
gaosongdeMacBook-Pro:bin gaosong$ sudo /Applications/XAMPP/xamppfiles/bin/pecl install memcache
downloading memcache-2.2.7.tgz ...
Starting to download memcache-2.2.7.tgz (36,459 bytes)
..........done: 36,459 bytes
11 source files, building
running: phpize
Configuring for:
PHP Api Version: 20121113
Zend Module Api No: 20121212
Zend Extension Api No: 220121212
Enable memcache session handler support? [yes] :
building in /private/tmp/pear/install/pear-build-roote06YHQ/memcache-2.2.7
running: /private/tmp/pear/install/memcache/configure --enable-memcache-session=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-darwin15.0.0
checking host system type... x86_64-apple-darwin15.0.0
checking target system type... x86_64-apple-darwin15.0.0
checking for PHP prefix... /usr/local/Cellar/php55/5.5.30
checking for PHP includes... -I/usr/local/Cellar/php55/5.5.30/include/php -I/usr/local/Cellar/php55/5.5.30/include/php/main -I/usr/local/Cellar/php55/5.5.30/include/php/TSRM -I/usr/local/Cellar/php55/5.5.30/include/php/Zend -I/usr/local/Cellar/php55/5.5.30/include/php/ext -I/usr/local/Cellar/php55/5.5.30/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/Cellar/php55/5.5.30/lib/php/extensions/no-debug-non-zts-20121212
checking for PHP installed headers prefix... /usr/local/Cellar/php55/5.5.30/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 memcache support... yes, shared
checking whether to enable memcache session handler support... yes
checking for the location of ZLIB... no
checking for the location of zlib... configure: error: memcache support requires ZLIB. Use --with-zlib-dir=<DIR> to specify prefix where ZLIB include and library are located
ERROR: `/private/tmp/pear/install/memcache/configure --enable-memcache-session=yes' failed
But I have installed ZLIB by homebrew:
gaosongdeMacBook-Pro:~ gaosong$ brew install zlib
Warning: homebrew/dupes/zlib-1.2.8 already installed
I Use --with-zlib-dir= to specify prefix where ZLIB include and library are located like that :
sudo ./pecl install memcached --with-zlib-dir=/usr/local/opt/zlib
or
sudo ./pecl install memcache --with-zlib-dir=/usr/local
but it get the same result :(
Could you help me to install the memcache successfully?
Thank you very much!

Adding GMP PHP extension to MAMP

Trying to use MAMP 3.4 with the latest version of PHP currently on there (5.6.10) but I need the PHP extension GMP. My understanding is that that extension is not a separate module but requires a complete re-compile of PHP with --with-gmp.
Trying to follow the guide linked here with clean 5.6.10 source code but I get the same error the OP is having:
Didiers-MacBook-Pro:php-5.6.10 didier$ ./configure --with-mysql=/Applications/MAMP/Library --with-apxs2=/Applications/MAMP/Library/bin/apxs --with-gd --with-jpeg-dir=/Applications/MAMP/Library --with-png-dir=/Applications/MAMP/Library --with-zlib --with-freetype-dir=/Applications/MAMP/Library --prefix=/Applications/MAMP/bin/php5 --exec-prefix=/Applications/MAMP/bin/php5 --sysconfdir=/Applications/MAMP/conf/php5 --with-soap --with-config-file-path=/Applications/MAMP/conf/php5 --enable-track-vars --enable-bcmath --enable-ftp --enable-gd-native-ttf --with-bz2=/usr --with-ldap --with-mysqli=/Applications/MAMP/Library/bin/mysql_config --with-sqlite --with-ttf --with-t1lib=/Applications/MAMP/Library --enable-mbstring=all --with-curl=/Applications/MAMP/Library --enable-dbx --enable-sockets --enable-bcmath --with-imap=shared,/Applications/MAMP/Library/lib/imap-2006i --enable-soap --with-kerberos --enable-calendar --with-pgsql=shared,/Applications/MAMP/Library/pg --enable-dbase --enable-exif --with-libxml-dir=/Applications/MAMP/Library --with-gettext=shared,/Applications/MAMP/Library --with-xsl=/Applications/MAMP/Library --with-pdo-mysql=/Applications/MAMP/Library --with-pdo-pgsql=shared,/Applications/MAMP/Library/pg --with-mcrypt=shared,/Applications/MAMP/Library --with-openssl --with-gmp --without-iconv --prefix=/Users/Didier/Desktop/result
configure: WARNING: unrecognized options: --with-soap, --enable-track-vars, --with-sqlite, --with-ttf, --enable-dbx, --enable-dbase
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 build system type... x86_64-apple-darwin14.5.0
checking host system type... x86_64-apple-darwin14.5.0
checking target system type... x86_64-apple-darwin14.5.0
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 how to run the C preprocessor... cc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking whether ln -s works... yes
checking for system library directory... lib
checking whether to enable runpaths... yes
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking for gawk... no
checking for nawk... no
checking for awk... awk
checking if awk is broken... no
checking for bison... bison -y
checking for bison version... invalid
configure: WARNING: This bison version is not supported for regeneration of the Zend/PHP parsers (found: 2.3, min: 204, excluded: 3.0).
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking whether to enable computed goto gcc extension with re2c... no
checking whether cc supports -no-cpp-precomp... yes
checking whether to force non-PIC code in shared modules... no
checking whether /dev/urandom exists... yes
checking for pthreads_cflags...
checking for pthreads_lib...
Configuring SAPI modules
checking for AOLserver support... no
checking for Apache 1.x module support via DSO through APXS... no
checking for Apache 1.x module support... no
checking whether to enable Apache charset compatibility option... no
checking for Apache 2.0 filter-module support via DSO through APXS... no
checking for Apache 2.0 handler-module support via DSO through APXS...
Sorry, I cannot run apxs. Possible reasons follow:
1. Perl is not installed
2. apxs was not found. Try to pass the path using --with-apxs2=/path/to/apxs
3. Apache was not built using --enable-so (the apxs usage page is displayed)
The output of /Applications/MAMP/Library/bin/apxs follows:
cannot open /Applications/MAMP/Library/build/config_vars.mk: No such file or directory at /Applications/MAMP/Library/bin/apxs line 217.
configure: error: Aborting
Turns out that you need some critical files from httpd in order to build php as a Apache modules (as MAMP requires). MAMP ommits those files from the install.
Download Apache from http://mirror.reverse.net/pub/apache/httpd/
Make sure that the version you're downloading is the same one found in the MAMP distribution. You can type /Applications/MAMP/Library/bin/httpd -version from the command line in order to find out.
Un-tar the distribution and cd into it.
Make a folder somewhere to store the build results. We'll put our files on the desktop, in something like ~/Desktop/build/httpd.
Next step is to build httpd. Something like ./configure --prefix=/Users/[username]/Desktop/build/httpd --enable-so should do the trick. Note the the install path needs to be absolute so we can't use the tilde character here.
Once configuration is finished and without any errors, make and then make install. You now have a Apache server compiled from source. Congrats!
From that build, we need to grab the files missing from our MAMP install. This is actually a single directory located at ~/Desktop/build/httpd/build. Copy this into /Applications/MAMP/Library and you will now be able to build PHP without that aforementioned error message. Make sure that you copy the directory and don't move it. You will need it later during the PHP compilation.
Next step is to compile PHP itself:
Download the PHP source from http://php.net/downloads.php.
Make sure that you are downloading the same version that you're trying to replace (you can find all the versions MAMP has in store in /Applications/MAMP/bin/php. In my case I'm building 5.6.10.
Un-tar the distribution and cd into it.
Make a folder somewhere to store the build results. Once again, I'm putting my results on my desktop in ~/Desktop/build/php.
Configure PHP to build what you need with something like ./configure --with-apxs2=/Applications/MAMP/Library/bin/apxs --prefix=/Users/[username]/Desktop/build/php --with-openssl --without-iconv. If you want you can look at the existing phpinfo page for the version you're replacing to find out what it was compiled with. Keep in mind that some modules will require you to have built from source copies of some other libraries.
make and make install.
You now have a shared object for php that you can use with MAMP. Close MAMP, copy ~/Dekstop/build/httpd/modules/libphp5.so into /Applications/MAMP/bin/php/php5.6.10/modules and restart it. Keeping a copy of the previous libphp5.so file is not a bad idea just in case things go south.

Categories