diff -aurN a/configure.ac b/configure.ac --- a/configure.ac 2014-05-10 18:38:09.000000000 -0400 +++ b/configure.ac 2016-10-12 14:27:04.635849601 -0400 @@ -153,13 +153,17 @@ fi fi +AC_ARG_WITH([php-config], + AS_HELP_STRING([--with-php-config=path], [Custom path to php-config])) +AS_IF([test "x$with_php_config" != "x"], + [AC_CHECK_PROG(PHP_CONFIG, php-config, ["$with_php_config/php-config"], [], [$with_php_config])], + [AC_CHECK_PROG(PHP_CONFIG, php-config, php-config)]) -AC_CHECK_PROG(PHP_CONFIG, php-config, php-config) if test "X$PHP_CONFIG" != X ; then - PHP_VERSION=`$PHP_CONFIG --version` - PHP_INCLUDES=`$PHP_CONFIG --includes` - PHP_EXTENSION_DIR=`$PHP_CONFIG --extension-dir` + PHP_VERSION=`${PHP_CONFIG} --version` + PHP_INCLUDES=`${PHP_CONFIG} --includes` + PHP_EXTENSION_DIR=`${PHP_CONFIG} --extension-dir` if test $PHP_VERSION '>' 5.0.0; then PHP_SWIG="-php5" @@ -445,7 +449,7 @@ with_php=yes fi -PHP_VERSION=`php-config --version 2>/dev/null` +PHP_VERSION=`${PHP_CONFIG} --version 2>/dev/null` if test "X$PHP_VERSION" != X; then languages_available="$languages_available php($PHP_VERSION)" if test $with_php = yes; then