Skip to content

Commit 247b4d8

Browse files
committed
Remove support for EOL Apache 2.0 and 2.2 in favor of 2.4+
Apache 2.2 has been marked as EOL in December 2017 and doesn't receive security patches any longer. Also, most *nix distributions and packages mostly support 2.4 as minimum by now. https://forum.apachehaus.com/news-general-discussion/apache-2-2-users-your-time-is-running-out/ On Windows, this removes the configure option --enable-apache2-2handler and merges the --enable-apache2handler and --enable-apache2-4handler into a single option with favoring the --enable-apache2handler and marking the --enable-apache2-4handler as deprecated. - The upstream MODULE_MAGIC_NUMBER is deprecated in favor of MODULE_MAGIC_NUMBER_MAJOR in apache2/ap_mmn.h - The initial upstream MODULE_MAGIC_NUMBER_MAJOR was 20111025 in Apache 2.4.0 version.
1 parent 909d331 commit 247b4d8

File tree

7 files changed

+23
-60
lines changed

7 files changed

+23
-60
lines changed

UPGRADING.INTERNALS

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,10 @@ PHP 8.4 INTERNALS UPGRADE NOTES
157157
once used (use with_pear variable name).
158158

159159
c. Windows build system changes
160-
- The configure options --with-oci8-11g, --with-oci8-12c, --with-oci8-19 have
161-
been removed.
160+
- The configure options --with-oci8-11g, --with-oci8-12c, --with-oci8-19,
161+
--enable-apache2-2handler have been removed.
162+
- The configure option --enable-apache2-4handler is deprecated (use
163+
--enable-apache2handler).
162164
- Added Bison flag '-Wall' when generating lexer files as done in *nix build
163165
system.
164166
- HAVE_WIN32_NATIVE_THREAD, USE_WIN32_NATIVE_THREAD, ENABLE_THREADS symbols

configure.ac

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1827,8 +1827,7 @@ if test -n "\$REDO_ALL"; then
18271827
AWK="$AWK" sh $srcdir/build/genif.sh $srcdir/main/internal_functions.c.in "$EXT_CLI_STATIC" > main/internal_functions_cli.c
18281828
18291829
if test "$PHP_SAPI" = "apache2handler"; then
1830-
if test "$APACHE_VERSION" -ge 2004001; then
1831-
if test -z "$APACHE_THREADED_MPM"; then
1830+
if test -z "$APACHE_THREADED_MPM"; then
18321831
cat <<X
18331832
+--------------------------------------------------------------------+
18341833
| *** WARNING *** |
@@ -1837,7 +1836,6 @@ cat <<X
18371836
| If you change Apache to use a threaded MPM you must reconfigure |
18381837
| PHP with --enable-zts |
18391838
X
1840-
fi
18411839
fi
18421840
fi
18431841

sapi/apache2handler/CREDITS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Apache 2.0 Handler
1+
Apache 2 Handler
22
Ian Holsman, Justin Erenkrantz (based on Apache 2.0 Filter code)

sapi/apache2handler/config.m4

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ if test "$PHP_APXS2" != "no"; then
3939
APU_BINDIR=`$APXS -q APU_BINDIR`
4040
APR_BINDIR=`$APXS -q APR_BINDIR`
4141

42-
dnl Pick up ap[ru]-N-config if using httpd >=2.1
42+
dnl Pick up ap[ru]-N-config.
4343
APR_CONFIG=`$APXS -q APR_CONFIG 2>/dev/null ||
4444
echo $APR_BINDIR/apr-config`
4545
APU_CONFIG=`$APXS -q APU_CONFIG 2>/dev/null ||
@@ -56,10 +56,10 @@ if test "$PHP_APXS2" != "no"; then
5656

5757
APACHE_CFLAGS="$APACHE_CPPFLAGS -I$APXS_INCLUDEDIR $APR_CFLAGS $APU_CFLAGS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
5858

59-
dnl Test that we're trying to configure with apache 2.x
59+
dnl Check Apache version.
6060
PHP_AP_EXTRACT_VERSION($APXS_HTTPD)
61-
if test "$APACHE_VERSION" -lt 2000044; then
62-
AC_MSG_ERROR([Please note that Apache version >= 2.0.44 is required])
61+
if test "$APACHE_VERSION" -lt 2004000; then
62+
AC_MSG_ERROR([Please note that Apache version >= 2.4 is required])
6363
fi
6464

6565
APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR`
@@ -107,17 +107,8 @@ if test "$PHP_APXS2" != "no"; then
107107
;;
108108
esac
109109

110-
if test "$APACHE_VERSION" -lt 2004001; then
111-
APXS_MPM=`$APXS -q MPM_NAME`
112-
if test "$APXS_MPM" != "prefork" && test "$APXS_MPM" != "peruser" && test "$APXS_MPM" != "itk"; then
113-
PHP_BUILD_THREAD_SAFE
114-
fi
115-
else
116-
APACHE_THREADED_MPM=`$APXS_HTTPD -V 2>/dev/null | grep 'threaded:.*yes'`
117-
if test -n "$APACHE_THREADED_MPM"; then
118-
PHP_BUILD_THREAD_SAFE
119-
fi
120-
fi
110+
APACHE_THREADED_MPM=$($APXS_HTTPD -V 2>/dev/null | grep 'threaded:.*yes')
111+
AS_VAR_IF_SET([APACHE_THREADED_MPM], [PHP_BUILD_THREAD_SAFE])
121112
AC_MSG_RESULT(yes)
122113
PHP_SUBST(APXS)
123114
else

sapi/apache2handler/config.w32

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
// vim:ft=javascript
22

3-
ARG_ENABLE('apache2handler', 'Build Apache 2.x handler', 'no');
3+
ARG_ENABLE('apache2handler', 'Build Apache 2 handler', 'no');
4+
ARG_ENABLE('apache2-4handler', 'Build Apache 2 handler', 'no');
5+
6+
if(PHP_APACHE2_4HANDLER) {
7+
WARNING("--enable-apache2-4handler configure option is deprecated, use \
8+
--enable-apache2handler");
9+
}
410

511
if (PHP_APACHE2HANDLER != "no") {
612
if (PHP_ZTS == "no") {
7-
WARNING("Apache 2.0 module requires an --enable-zts build of PHP on windows");
13+
WARNING("Apache 2 module requires an --enable-zts build of PHP on windows");
814
} else if (CHECK_HEADER_ADD_INCLUDE("httpd.h", "CFLAGS_APACHE2HANDLER", PHP_PHP_BUILD + "\\include\\apache2") &&
915
CHECK_LIB("libhttpd.lib", "apache2handler", PHP_PHP_BUILD + "\\lib\\apache2") &&
1016
CHECK_LIB("libapr.lib", "apache2handler", PHP_PHP_BUILD + "\\lib\\apache2") &&
@@ -18,29 +24,10 @@ if (PHP_APACHE2HANDLER != "no") {
1824
}
1925
}
2026

21-
ARG_ENABLE('apache2-2handler', 'Build Apache 2.2.x handler', 'no');
22-
23-
if (PHP_APACHE2_2HANDLER != "no") {
24-
if (PHP_ZTS == "no") {
25-
WARNING("Apache 2.2 module requires an --enable-zts build of PHP on windows");
26-
} else if (CHECK_HEADER_ADD_INCLUDE("httpd.h", "CFLAGS_APACHE2_2HANDLER", PHP_PHP_BUILD + "\\include\\apache2_2") &&
27-
CHECK_LIB("libhttpd.lib", "apache2_2handler", PHP_PHP_BUILD + "\\lib\\apache2_2") &&
28-
CHECK_LIB("libapr-1.lib", "apache2_2handler", PHP_PHP_BUILD + "\\lib\\apache2_2") &&
29-
CHECK_LIB("libaprutil-1.lib", "apache2_2handler", PHP_PHP_BUILD + "\\lib\\apache2_2")
30-
) {
31-
SAPI('apache2_2handler', 'mod_php.c sapi_apache2.c apache_config.c php_functions.c',
32-
'php' + PHP_VERSION + 'apache2_2.dll',
33-
'/D PHP_APACHE2_EXPORTS /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1',
34-
'sapi\\apache2_2handler');
35-
} else {
36-
WARNING("Could not find apache2.2 libraries/headers");
37-
}
38-
}
39-
4027
ARG_ENABLE('apache2-4handler', 'Build Apache 2.4.x handler', 'no');
4128
if (PHP_APACHE2_4HANDLER != "no") {
4229
if (PHP_ZTS == "no") {
43-
WARNING("Apache 2.4 module requires an --enable-zts build of PHP on windows");
30+
WARNING("Apache 2 module requires an --enable-zts build of PHP on windows");
4431
} else if (CHECK_HEADER_ADD_INCLUDE("httpd.h", "CFLAGS_APACHE2_4HANDLER", PHP_PHP_BUILD + "\\include\\apache2_4") &&
4532
CHECK_LIB("libhttpd.lib", "apache2_4handler", PHP_PHP_BUILD + "\\lib\\apache2_4") &&
4633
CHECK_LIB("libapr-1.lib", "apache2_4handler", PHP_PHP_BUILD + "\\lib\\apache2_4") &&

sapi/apache2handler/php_functions.c

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,6 @@ PHP_FUNCTION(apache_lookup_uri)
141141
ADD_STRING(method);
142142
ADD_TIME(mtime);
143143
ADD_LONG(clength);
144-
#if MODULE_MAGIC_NUMBER < 20020506
145-
ADD_STRING(boundary);
146-
#endif
147144
ADD_STRING(range);
148145
ADD_LONG(chunked);
149146
ADD_STRING(content_type);
@@ -319,11 +316,7 @@ PHP_FUNCTION(apache_getenv)
319316

320317
static char *php_apache_get_version(void)
321318
{
322-
#if MODULE_MAGIC_NUMBER_MAJOR >= 20060905
323319
return (char *) ap_get_server_banner();
324-
#else
325-
return (char *) ap_get_server_version();
326-
#endif
327320
}
328321

329322
/* {{{ Fetch Apache version */
@@ -367,11 +360,7 @@ PHP_MINFO_FUNCTION(apache)
367360
char *p;
368361
server_rec *serv = ((php_struct *) SG(server_context))->r->server;
369362
#ifndef PHP_WIN32
370-
# if MODULE_MAGIC_NUMBER_MAJOR >= 20081201
371363
AP_DECLARE_DATA extern unixd_config_rec ap_unixd_config;
372-
# else
373-
AP_DECLARE_DATA extern unixd_config_rec unixd_config;
374-
# endif
375364
#endif
376365

377366
for (n = 0; ap_loaded_modules[n]; ++n) {
@@ -395,7 +384,7 @@ PHP_MINFO_FUNCTION(apache)
395384
if (apv && *apv) {
396385
php_info_print_table_row(2, "Apache Version", apv);
397386
}
398-
snprintf(tmp, sizeof(tmp), "%d", MODULE_MAGIC_NUMBER);
387+
snprintf(tmp, sizeof(tmp), "%d", MODULE_MAGIC_NUMBER_MAJOR);
399388
php_info_print_table_row(2, "Apache API Version", tmp);
400389

401390
if (serv->server_admin && *(serv->server_admin)) {
@@ -406,11 +395,7 @@ PHP_MINFO_FUNCTION(apache)
406395
php_info_print_table_row(2, "Hostname:Port", tmp);
407396

408397
#ifndef PHP_WIN32
409-
#if MODULE_MAGIC_NUMBER_MAJOR >= 20081201
410398
snprintf(tmp, sizeof(tmp), "%s(%d)/%d", ap_unixd_config.user_name, ap_unixd_config.user_id, ap_unixd_config.group_id);
411-
#else
412-
snprintf(tmp, sizeof(tmp), "%s(%d)/%d", unixd_config.user_name, unixd_config.user_id, unixd_config.group_id);
413-
#endif
414399
php_info_print_table_row(2, "User/Group", tmp);
415400
#endif
416401

sapi/apache2handler/sapi_apache2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ static int php_apache2_startup(sapi_module_struct *sapi_module)
388388

389389
static sapi_module_struct apache2_sapi_module = {
390390
"apache2handler",
391-
"Apache 2.0 Handler",
391+
"Apache 2 Handler",
392392

393393
php_apache2_startup, /* startup */
394394
php_module_shutdown_wrapper, /* shutdown */

0 commit comments

Comments
 (0)