]> git.pld-linux.org Git - packages/php.git/blob - php-apache24.patch
- make it possible to coinstall phpXY-pdo-pgsql
[packages/php.git] / php-apache24.patch
1 commit 949ef40139a008c9bbf387a677018f3a85fbf75a
2 Author: Christopher Jones <sixd@php.net>
3 Date:   Fri Mar 2 00:07:41 2012 +0000
4
5     Fixed bug #61172 (Add Apache 2.4 support)
6
7 diff --git a/configure.in b/configure.in
8 index 7ed2d93..8f579ef 100644
9 --- a/configure.in
10 +++ b/configure.in
11 @@ -1550,6 +1550,21 @@ cat <<X
12  X
13    fi
14  
15 +  if test "$PHP_SAPI" = "apache2handler" || test "$PHP_SAPI" = "apache2filter"; then
16 +    if test "$APACHE_VERSION" -ge 2004001; then
17 +      if test -z "$APACHE_THREADED_MPM"; then
18 +cat <<X
19 ++--------------------------------------------------------------------+
20 +|                        *** WARNING ***                             |
21 +|                                                                    |
22 +| You have built PHP for Apache's current non-threaded MPM.          |
23 +| If you change Apache to use a threaded MPM you must reconfigure    |
24 +| PHP with --enable-maintainer-zts                                   |
25 +X
26 +      fi
27 +    fi
28 +  fi
29 +
30    # Warn about linking Apache with libpthread if oci8 extension is enabled on linux.
31    if test "$PHP_OCI8" != "no"; then
32      if test "$PHP_SAPI" = "apache"; then
33 diff --git a/sapi/apache2filter/config.m4 b/sapi/apache2filter/config.m4
34 index b10720a..c49488d 100644
35 --- a/sapi/apache2filter/config.m4
36 +++ b/sapi/apache2filter/config.m4
37 @@ -39,7 +39,6 @@ if test "$PHP_APXS2FILTER" != "no"; then
38    APXS_BINDIR=`$APXS -q BINDIR`
39    APXS_HTTPD=`$APXS -q SBINDIR`/`$APXS -q TARGET`
40    APXS_CFLAGS=`$APXS -q CFLAGS`
41 -  APXS_MPM=`$APXS -q MPM_NAME`
42    APU_BINDIR=`$APXS -q APU_BINDIR`
43    APR_BINDIR=`$APXS -q APR_BINDIR`
44  
45 @@ -118,8 +117,16 @@ if test "$PHP_APXS2FILTER" != "no"; then
46      ;;
47    esac
48  
49 -  if test "$APXS_MPM" != "prefork"; then
50 -    PHP_BUILD_THREAD_SAFE
51 +  if test "$APACHE_VERSION" -lt 2004001; then
52 +    APXS_MPM=`$APXS -q MPM_NAME`
53 +    if test "$APXS_MPM" != "prefork" && test "$APXS_MPM" != "peruser" && test "$APXS_MPM" != "itk"; then
54 +      PHP_BUILD_THREAD_SAFE
55 +    fi
56 +  else
57 +    APACHE_THREADED_MPM=`$APXS_HTTPD -V | grep 'threaded:.*yes'`
58 +    if test -n "$APACHE_THREADED_MPM"; then
59 +      PHP_BUILD_THREAD_SAFE
60 +    fi
61    fi
62    AC_MSG_RESULT(yes)
63    PHP_SUBST(APXS)
64 diff --git a/sapi/apache2handler/config.m4 b/sapi/apache2handler/config.m4
65 index 9521790..702f91f 100644
66 --- a/sapi/apache2handler/config.m4
67 +++ b/sapi/apache2handler/config.m4
68 @@ -38,7 +38,6 @@ if test "$PHP_APXS2" != "no"; then
69    APXS_BINDIR=`$APXS -q BINDIR`
70    APXS_HTTPD=`$APXS -q SBINDIR`/`$APXS -q TARGET`
71    APXS_CFLAGS=`$APXS -q CFLAGS`
72 -  APXS_MPM=`$APXS -q MPM_NAME`
73    APU_BINDIR=`$APXS -q APU_BINDIR`
74    APR_BINDIR=`$APXS -q APR_BINDIR`
75  
76 @@ -117,8 +116,16 @@ if test "$PHP_APXS2" != "no"; then
77      ;;
78    esac
79  
80 -  if test "$APXS_MPM" != "prefork"; then
81 -    PHP_BUILD_THREAD_SAFE
82 +  if test "$APACHE_VERSION" -lt 2004001; then
83 +    APXS_MPM=`$APXS -q MPM_NAME`
84 +    if test "$APXS_MPM" != "prefork" && test "$APXS_MPM" != "peruser" && test "$APXS_MPM" != "itk"; then
85 +      PHP_BUILD_THREAD_SAFE
86 +    fi
87 +  else
88 +    APACHE_THREADED_MPM=`$APXS_HTTPD -V | grep 'threaded:.*yes'`
89 +    if test -n "$APACHE_THREADED_MPM"; then
90 +      PHP_BUILD_THREAD_SAFE
91 +    fi
92    fi
93    AC_MSG_RESULT(yes)
94    PHP_SUBST(APXS)
95 commit 019bdff3951f415e2d5c44933da30a4669c628e8
96 Author: Pierre Joye <pierre.php@gmail.com>
97 Date:   Tue Nov 13 19:34:00 2012 +0100
98
99     Enabled apache 2.4 handler build option
100
101 diff --git a/sapi/apache2handler/config.w32 b/sapi/apache2handler/config.w32
102 index 2f2084c..d09e165 100644
103 --- a/sapi/apache2handler/config.w32
104 +++ b/sapi/apache2handler/config.w32
105 @@ -37,3 +37,22 @@ if (PHP_APACHE2_2HANDLER != "no") {
106                 WARNING("Could not find apache2.2 libraries/headers");
107         }
108  }
109 +
110 +ARG_ENABLE('apache2-4handler', 'Build Apache 2.4.x handler', 'no');
111 +if (PHP_APACHE2_4HANDLER != "no") {
112 +       if (PHP_ZTS == "no") {
113 +               WARNING("Apache 2.4 module requires an --enable-zts build of PHP on windows");
114 +       } else if (CHECK_HEADER_ADD_INCLUDE("httpd.h", "CFLAGS_APACHE2_4HANDLER", PHP_PHP_BUILD + "\\include\\apache2_4") &&
115 +                       CHECK_LIB("libhttpd.lib", "apache2_4handler", PHP_PHP_BUILD + "\\lib\\apache2_4") &&
116 +                       CHECK_LIB("libapr-1.lib", "apache2_4handler", PHP_PHP_BUILD + "\\lib\\apache2_4") &&
117 +                       CHECK_LIB("libaprutil-1.lib", "apache2_4handler", PHP_PHP_BUILD + "\\lib\\apache2_4")
118 +                       ) {
119 +               SAPI('apache2_4handler', 'mod_php5.c sapi_apache2.c apache_config.c php_functions.c',
120 +                               'php' + PHP_VERSION + 'apache2_4.dll',
121 +                               '/D PHP_APACHE2_EXPORTS /I win32',
122 +                               'sapi\\apache2handler');
123 +       } else {
124 +               WARNING("Could not find apache 2.4 libraries/headers");
125 +       }
126 +}
127 +
128 --- php-5.2.17/acinclude.m4~    2013-04-10 12:57:07.000000000 +0200
129 +++ php-5.2.17/acinclude.m4     2013-04-10 13:22:13.515018845 +0200
130 @@ -2586,6 +2586,9 @@
131  dnl
132  AC_DEFUN([PHP_AP_EXTRACT_VERSION],[
133    ac_output=`$1 -v 2>&1 | grep version`
134 +  if test -n "$FORCE_APACHE_VERSION"; then
135 +    ac_output="Server version: Apache/${FORCE_APACHE_VERSION} (PLD/Linux)"
136 +  fi
137    ac_IFS=$IFS
138  IFS="- /.
139  "
140
141 commit 390ccd899d73101ad5ddcfc46074a6c83ec178e8
142 Author: Scott MacVicar <scottmac@php.net>
143 Date:   Mon Jan 19 19:32:40 2009 +0000
144
145     MFH Fix apache2handler under Apache 2.3.0-alpha
146
147 diff --git a/sapi/apache2handler/php_functions.c b/sapi/apache2handler/php_functions.c
148 index 45f7ac3..3b9321a 100644
149 --- a/sapi/apache2handler/php_functions.c
150 +++ b/sapi/apache2handler/php_functions.c
151 @@ -372,8 +372,12 @@ PHP_MINFO_FUNCTION(apache)
152         char *p;
153         server_rec *serv = ((php_struct *) SG(server_context))->r->server;
154  #if !defined(WIN32) && !defined(WINNT) && !defined(NETWARE)
155 +#if MODULE_MAGIC_NUMBER_MAJOR >= 20081201
156 +       AP_DECLARE_DATA extern unixd_config_rec ap_unixd_config;
157 +#else
158         AP_DECLARE_DATA extern unixd_config_rec unixd_config;
159  #endif
160 +#endif
161         
162         for (n = 0; ap_loaded_modules[n]; ++n) {
163                 char *s = (char *) ap_loaded_modules[n]->name;
164 @@ -403,7 +407,11 @@ PHP_MINFO_FUNCTION(apache)
165         php_info_print_table_row(2, "Hostname:Port", tmp);
166         
167  #if !defined(WIN32) && !defined(WINNT) && !defined(NETWARE)
168 +#if MODULE_MAGIC_NUMBER_MAJOR >= 20081201
169 +       snprintf(tmp, sizeof(tmp), "%s(%d)/%d", ap_unixd_config.user_name, ap_unixd_config.user_id, ap_unixd_config.group_id);
170 +#else
171         snprintf(tmp, sizeof(tmp), "%s(%d)/%d", unixd_config.user_name, unixd_config.user_id, unixd_config.group_id);
172 +#endif
173         php_info_print_table_row(2, "User/Group", tmp);
174  #endif
175  
This page took 0.032115 seconds and 3 git commands to generate.