#19209 [Opn->Fbk]: sapi_apache2.c fails to compile with Apache 2.0.40 library
| From: | kalowsky@php.net | Date: | Sat, 31 Aug 2002 04:14:38 +0000 |
| Subject: | #19209 [Opn->Fbk]: sapi_apache2.c fails to compile with Apache 2.0.40 library | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-18303@lists.php.net to get a copy of this message | ||
ID: 19209
Updated by: kalowsky@php.net
Reported By: tony@lava.net
-Status: Open
+Status: Feedback
Bug Type: Compile Failure
Operating System: BSDI 4.3
PHP Version: 4.2.2
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php4-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2002-08-31 00:11:49] tony@lava.net
First I modified php_functions.c and changed "MODULE_MAGIC_AT_LEAST" to
"AP_MODULE_MAGIC_AT_LEAST"
Then I proceeded with building:
./configure --with-apxs2=/usr/local/apache2/bin/apxs
make
This eventually gave the following errors:
sapi_apache2.c: In function `php_register_hook':
sapi_apache2.c:534: warning: passing arg 3 of
`ap_register_output_filter' makes pointer from integer without a cast
sapi_apache2.c:534: too few arguments to function
`ap_register_output_filter'
sapi_apache2.c:535: warning: passing arg 3 of
`ap_register_input_filter' makes pointer from integer without a cast
sapi_apache2.c:535: too few arguments to function
`ap_register_input_filter'
I tracked this down to a change made recently in Apache's include file
util_filter.h. The older functions are defined as:
AP_DECLARE(ap_filter_rec_t *) ap_register_input_filter(const char
*name, ap_in_filter_func filter_func, ap_filter_type ftype);
AP_DECLARE(ap_filter_rec_t *) ap_register_output_filter(const char
*name, ap_out_filter_func filter_func, ap_filter_type ftype);
The newer functions have an additional argument:
AP_DECLARE(ap_filter_rec_t *) ap_register_input_filter(const char
*name, ap_in_filter_func filter_func, ap_init_filter_func filter_init,
ap_filter_type ftype);
AP_DECLARE(ap_filter_rec_t *) ap_register_output_filter(const char
*name, ap_out_filter_func filter_func, ap_init_filter_func filter_init,
ap_filter_type ftype);
Not sure what the appropriate fix is. I just added a NULL to the third
argument in the function call to sapi_apache2filter.c and it compiles
ok. Here's a diff.
--- sapi/apache2filter/sapi_apache2.c.orig Mon May 6 05:42:23
2002
+++ sapi/apache2filter/sapi_apache2.c Fri Aug 30 17:53:22 2002
@@ -531,8 +531,8 @@
ap_hook_post_config(php_apache_server_startup, NULL, NULL,
APR_HOOK_MIDDLE);
ap_hook_insert_filter(php_insert_filter, NULL, NULL,
APR_HOOK_MIDDLE);
ap_hook_post_read_request(php_post_read_request, NULL, NULL,
APR_HOOK_MIDDLE);
- ap_register_output_filter("PHP", php_output_filter,
AP_FTYPE_RESOURCE);
- ap_register_input_filter("PHP", php_input_filter,
AP_FTYPE_RESOURCE);
+ ap_register_output_filter("PHP", php_output_filter, NULL,
AP_FTYPE_RESOURCE);
+ ap_register_input_filter("PHP", php_input_filter, NULL,
AP_FTYPE_RESOURCE);
}
AP_MODULE_DECLARE_DATA module php4_module = {
Apache starts up but doesn't process any PHP code. Any hints would be
appreciated.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=19209&edit=1