php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19209 sapi_apache2.c fails to compile with Apache 2.0.40 library
Submitted: 2002-08-31 00:11 UTC Modified: 2002-09-03 18:14 UTC
From: tony at lava dot net Assigned:
Status: Closed Package: Compile Failure
PHP Version: 4.2.2 OS: BSDI 4.3
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: tony at lava dot net
New email:
PHP Version: OS:

 

 [2002-08-31 00:11 UTC] tony at lava dot 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.



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-08-31 00:14 UTC] kalowsky@php.net
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


 [2002-09-03 18:14 UTC] sniper@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 00:00:02 2026 UTC