php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24016 Cannot compile 4.3.2 with Apache 2.0.45/2.0.46 due to redeclaration of regex
Submitted: 2003-06-04 09:14 UTC Modified: 2003-06-04 23:15 UTC
From: chris at inglenook dot co dot uk Assigned:
Status: Closed Package: Apache2 related
PHP Version: 4.3.2 OS: Redhat Linux 9
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: chris at inglenook dot co dot uk
New email:
PHP Version: OS:

 

 [2003-06-04 09:14 UTC] chris at inglenook dot co dot uk
Compiling with the following configure line (in an rpm compile so that's what the variables are):

%configure \
        --prefix=%{_prefix} \
        --with-config-file-path=%{_sysconfdir}/php \
        --enable-force-cgi-redirect \
        --enable-pic \
        --disable-rpath \
        --enable-inline-optimization \
        --with-bz2 \
        --with-db4 \
        --with-curl \
        --with-dom=%{_prefix} \
        --with-exec-dir=%{_bindir} \
        --with-freetype-dir=%{_prefix} \
        --with-png-dir=%{_prefix} \
        --with-gd \
        --enable-gd-native-ttf \
        --with-ttf \
        --with-gdbm \
        --with-gettext=shared \
        --with-ncurses \
        --with-gmp \
        --with-iconv \
        --with-jpeg-dir=%{_prefix} \
        --with-openssl \
        --with-png \
        --with-pspell \
        --with-regex=system \
        --with-xml \
        --with-expat-dir=%{_prefix} \
        --with-zlib \
        --with-layout=GNU \
        --enable-bcmath \
        --enable-debugger \
        --enable-exif \
        --with-pear=/usr/share/pear \
        --enable-magic-quotes \
        --enable-safe-mode \
        --enable-sockets \
        --enable-discard-path \
        --enable-track-vars \
        --enable-trans-sid \
        --enable-yp \
        --enable-wddx \
        --without-oci8 \
        --with-imap=shared \
        --with-imap-ssl \
        --with-kerberos=/usr/kerberos \
        --with-ldap=shared \
        --enable-sysvsem=shared \
        --enable-sysvshm=shared \
        --enable-ftp=shared \
        --with-mysql=%{_prefix} \
        --with-mcrypt \
%if %{oracle}
        --with-oci8=shared \
%endif
        --enable-memory-limit \
        --enable-bcmath \
        --enable-shmop \
        --enable-versioning \
        --enable-calendar \
        --enable-dbx \
        --enable-dio \
        --enable-mbstring \
        $*

This line works fine with php 4.3.1 and Apache 2.0.45 and 2.0.46.

PHP 4.3.2 introduces the apache2handler - this is where the problem comes in.

The compile bombs out due to redeclaration or regex constants.

I think that this could be fixed by removing --with-regex=system

However, for PHP 4.3.1 and apache2filter the following line prevents this problem:

if test "$PHP_SAPI" = "apache" || test "$PHP_SAPI" = "apache2filter"; then

This goes on to force the use of php regex. This is in the configure script, and comes from ext/standard/config.m4

I'm submitting this as although there may be workarounds, if the problem can be fixed so a compile script from 4.3.1 can also work with 4.3.2 then it might stop others having the same trouble.

Patching this line to include apache2filter solves the compilation problem:

if test "$PHP_SAPI" = "apache" || test "$PHP_SAPI" = "apache2filter" || test "$PHP_SAPI" = "apache2handler"; then

The patch i use before compilation:

--- php-4.3.2/ext/standard/config.m4   2003-06-03 08:28:23.000000000 +0100
+++ php-4.3.2/ext/standard/config.m4       2003-06-03 08:28:10.000000000 +0100
@@ -205,7 +205,7 @@
 [
   case $withval in 
     system)
-      if test "$PHP_SAPI" = "apache" || test "$PHP_SAPI" = "apache2filter"; then
+      if test "$PHP_SAPI" = "apache" || test "$PHP_SAPI" = "apache2filter" || test "$PHP_SAPI" = "apache2handler"; then
         REGEX_TYPE=php
       else
         REGEX_TYPE=system

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-06-04 09:18 UTC] iliaa@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Remove --with-regex=system from your configure line and recompile.
 [2003-06-04 10:20 UTC] iliaa@php.net
Perphaps a further explanation for the bogusing is needed ;).

While your patch may work for you, it does present several issues. First of all apache 1 sapi works fine with system regex and so does Apache 2 2.0.44 (at least in my tests). So, the patch itself is not entirely valid. The problem you describe may infact be a temporary issue that Apache 2 developers may resolve in later releases. Therefor, arbitrarily disallowing system regex for users of apache sapis, is not a good idea, at least IMO.
 [2003-06-04 10:29 UTC] chris at inglenook dot co dot uk
fair enough

i figured that as it was already switching to the php regex for apache and apache2filter out of the box, then it seemed to fit in with the way things were done to do it for apache2handler aswell.

if my machine wasn't so slow to compile then i'd look to see what changed from 2.0.44 - as i've tried both 2.0.45 and 2.0.46 as i said, both have the problem.

4.3.1 didn't have the problem as it was covered by the apache2filter test.
 [2003-06-04 23:15 UTC] sniper@php.net
Fixed in CVS.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 03 13:01:32 2024 UTC