#19209 [NEW]: sapi_apache2.c fails to compile with Apache 2.0.40 library
| From: | tony at lava dot net | Date: | Sat, 31 Aug 2002 04:11:50 +0000 |
| Subject: | #19209 [NEW]: sapi_apache2.c fails to compile with Apache 2.0.40 library | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-18302@lists.php.net to get a copy of this message | ||
From: tony@lava.net
Operating system: BSDI 4.3
PHP version: 4.2.2
PHP Bug Type: Compile Failure
Bug description: sapi_apache2.c fails to compile with Apache 2.0.40 library
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 bug report at http://bugs.php.net/?id=19209&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=19209&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=19209&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=19209&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=19209&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=19209&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=19209&r=support
Expected behavior: http://bugs.php.net/fix.php?id=19209&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=19209&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=19209&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=19209&r=globals