php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #18204 Wrong calls of ap_register_output_filter and ap_register_input_filter functions
Submitted: 2002-07-06 21:18 UTC Modified: 2002-07-07 12:10 UTC
Votes:3
Avg. Score:4.0 ± 0.0
Reproduced:3 of 3 (100.0%)
Same Version:3 (100.0%)
Same OS:3 (100.0%)
From: krok at void dot ru Assigned:
Status: Not a bug Package: Compile Failure
PHP Version: 4CVS-2002-07-06 OS: FreeBSD 4.6-RELEASE-p1 i386
Private report: No CVE-ID: None
 [2002-07-06 21:18 UTC] krok at void dot ru
There are wrong calls of ap_register_output_filter and ap_register_input_filter functions in the php_register_hook function.
File sapi/apache2filter/sapi_apache2.c lines 567 and 568.
Instead of

ap_register_output_filter("PHP", php_output_filter, NULL, AP_FTYPE_RESOURCE);      
ap_register_input_filter("PHP", php_input_filter, NULL, AP_FTYPE_RESOURCE); 

you must use

ap_register_output_filter("PHP", php_output_filter, AP_FTYPE_RESOURCE);      
ap_register_input_filter("PHP", php_input_filter, AP_FTYPE_RESOURCE); 

because in the apache2 api there are only three parameters in these functions.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-07-06 21:49 UTC] sniper@php.net
Please let me know the output of 'httpd -v'

 [2002-07-07 06:43 UTC] krok at void dot ru
/usr/local/apache2/bin/httpd -v
Server version: Apache/2.0.39
Server built:   Jul  6 2002 17:42:06
[krok@frost] /home/krok$ /usr/local/apache2/bin/httpd -l
Compiled in modules:
  core.c
  prefork.c
  http_core.c
  mod_so.c
[krok@frost] /home/krok$ /usr/local/apache2/bin/httpd -V
Server version: Apache/2.0.39
Server built:   Jul  6 2002 17:42:06
Server's Module Magic Number: 20020612:1
Architecture:   32-bit
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6
 -D APR_USE_FLOCK_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D HTTPD_ROOT="/usr/local/apache2"
 -D SUEXEC_BIN="/usr/local/apache2/bin/suexec"
 -D DEFAULT_PIDLOG="logs/httpd.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="logs/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="conf/mime.types"
 -D SERVER_CONFIG_FILE="conf/httpd.conf"
[krok@frost] /home/krok$
 [2002-07-07 06:47 UTC] krok at void dot ru
When I've corrected source of sapi/apache2filter/sapi_apache2.c I've compilled php successfullly.
I've tested apache2+php+mysql and all fine, IMHO...
 [2002-07-07 06:52 UTC] derick@php.net
You need the latest versiono of Apache 2 if you want to use the latest CVS version of PHP. The latest Apache 2 version is 2.0.40 CVS.

Derick
 [2002-07-07 08:08 UTC] krok at void dot ru
I've decided to try latest CVS php because relase PHP 4.2.1 has failed to compile :

....
/bin/sh /slave/distr/php-4.2.1/libtool --silent --mode=compile gcc  -I. -I/slave/distr/php-4.2.1/sapi/apache2filter -I/slave/distr/php-4.2.1/main -I/slave/distr/php-4.2.1 -I/usr/local/apache2/include -I/slave/distr/php-4.2.1/Zend -I/usr/local/include -I/usr/local/mysql/include/mysql -I/usr/local/pgsql/include -I/slave/distr/php-4.2.1/ext/xml/expat  -D_REENTRANT -D_THREAD_SAFE -I/slave/distr/php-4.2.1/TSRM -I/usr/local/include/pth -g -O2 -pthread -DZTS -prefer-pic  -c php_functions.c
php_functions.c:93: syntax error
*** Error code 1

Stop in /slave/distr/php-4.2.1/sapi/apache2filter.
*** Error code 1

Stop in /slave/distr/php-4.2.1/sapi/apache2filter.
*** Error code 1

Stop in /slave/distr/php-4.2.1/sapi.
*** Error code 1

Stop in /slave/distr/php-4.2.1.

Also, after configure there are following desclimer :

+--------------------------------------------------------------------+
|                        *** WARNING ***                             |
|                                                                    |
| Apache 2 Support is EXPERIMENTAL and should NOT be used in         |
| production environment. Before submitting bug reports, try the     |
| latest CVS snapshot from http://snaps.php.net                      |


May be it's time to release PHP with apache2 support ? 8-)

Thanks, anyway.
 [2002-07-07 12:10 UTC] sniper@php.net
I just fixed the version check..you actually
need apache 2.0.40 (from CVS) with PHP 4.3.0-dev (from CVS)

 [2002-08-09 23:13 UTC] carl at bl dot echidna dot id dot au
The funny thing is this has worked with 4.2.1 and
apache 2.0.36 and .39, but is now broken with 
apache 2.0.40 and php 4.2.1 and 4.2.2, so the change
appears to have been made by apache, not PHP.

I've been running apache2 for some time, and PHP 4.2.x
has been great up 'til today when I'm trying to get 
it running with 2.0.40.  Looks like I'm backing out to
2.0.39 (cygwin problems don't apply to OpenBSD :) )
 [2002-08-09 23:16 UTC] carl at bl dot echidna dot id dot au
4.2.2 works just fine with apache 2.0.39 on OpenBSD 2.9...
 [2002-08-22 04:50 UTC] mtx9180 at hotmail dot com
the bug fix here needs to be undone.. Apache 2.0.40, the ap_register_output_filter and ap_register_input_filter functions do have 4 parameters. PHP 4.2.2 will not compile with-apxs2 unless the change is undone!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 05 06:01:33 2024 UTC