Skip to content

Commit 19e4d35

Browse files
committed
PHPC-1082: Add a PHP version check to config.m4
1 parent 52dcf36 commit 19e4d35

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

config.m4

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,15 @@ AC_DEFUN([PHP_BSON_CLOCK],
8383
fi
8484
])
8585

86-
AC_MSG_CHECKING(PHP version)
87-
PHP_FOUND_VERSION=`${PHP_CONFIG} --version`
88-
PHP_FOUND_VERNUM=`echo "${PHP_FOUND_VERSION}" | $AWK 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 100 + [$]2) * 100 + [$]3;}'`
89-
AC_MSG_RESULT($PHP_FOUND_VERNUM)
90-
9186
if test "$MONGODB" != "no"; then
87+
AC_MSG_CHECKING([Check for supported PHP versions])
88+
PHP_MONGODB_FOUND_VERSION=`${PHP_CONFIG} --version`
89+
PHP_MONGODB_FOUND_VERNUM=`echo "${PHP_MONGODB_FOUND_VERSION}" | $AWK 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 100 + [$]2) * 100 + [$]3;}'`
90+
AC_MSG_RESULT($PHP_MONGODB_FOUND_VERSION)
91+
if test "$PHP_MONGODB_FOUND_VERNUM" -lt "50500"; then
92+
AC_MSG_ERROR([not supported. Need a PHP version >= 5.5.0 (found $PHP_MONGODB_FOUND_VERSION)])
93+
fi
94+
9295
PHP_ARG_ENABLE(developer-flags, whether to enable developer build flags,
9396
[ --enable-developer-flags Enable developer flags],, no)
9497

0 commit comments

Comments
 (0)