From 1f847a0bdfea3f754e5d46f9e016ce2530e5d9a4 Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Mon, 8 Jul 2024 17:15:09 +0200 Subject: [PATCH] Check Apache HTTP Server command-line utility (#14173) The Apache HTTP server command-line tool (/usr/sbin/apache2) might be part of a separate package, such as apache2-bin or similar. If not installed, the configure script can still find the apxs tool, but previously didn't check for the HTTP server tool separately. Otherwise, configure syntax errors (integer expression expected) are thrown when checking for the Apache version. --- build/php.m4 | 2 ++ sapi/apache2handler/config.m4 | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/build/php.m4 b/build/php.m4 index 1504bfe12cd..4517bd69964 100644 --- a/build/php.m4 +++ b/build/php.m4 @@ -2040,6 +2040,7 @@ dnl dnl This macro is used to get a comparable version for Apache. dnl AC_DEFUN([PHP_AP_EXTRACT_VERSION],[ +AS_IF([test -x "$1"], [ ac_output=`$1 -v 2>&1 | grep version | $SED -e 's/Oracle-HTTP-//'` ac_IFS=$IFS IFS="- /. @@ -2049,6 +2050,7 @@ IFS="- /. APACHE_VERSION=`expr [$]4 \* 1000000 + [$]5 \* 1000 + [$]6` ]) +]) dnl dnl PHP_CONFIG_NICE(filename) diff --git a/sapi/apache2handler/config.m4 b/sapi/apache2handler/config.m4 index 4e70793678c..b4593c6a0e9 100644 --- a/sapi/apache2handler/config.m4 +++ b/sapi/apache2handler/config.m4 @@ -34,6 +34,11 @@ if test "$PHP_APXS2" != "no"; then APXS_INCLUDEDIR=`$APXS -q INCLUDEDIR` APXS_HTTPD=`$APXS -q SBINDIR`/`$APXS -q TARGET` + AS_IF([test ! -x "$APXS_HTTPD"], [AC_MSG_ERROR([m4_normalize([ + $APXS_HTTPD executable not found. Please, install Apache HTTP Server + command-line utility. + ])])]) + APXS_CFLAGS=`$APXS -q CFLAGS` APU_BINDIR=`$APXS -q APU_BINDIR` APR_BINDIR=`$APXS -q APR_BINDIR`