PHP Bugs  
php.net | support | documentation | report a bug | advanced search | search howto | statistics | login

go to bug id or search bugs for  

Bug #25704 Configuration issue with regex
Submitted:30 Sep 2003 11:15am UTC Modified: 2 Oct 2003 12:01pm UTC
From:stephen dot irven at britishwaterways dot co dot uk Assigned to:
Status:Bogus Category:Regexps related
Version:4.3.3 OS:Redhat 8 (kernel 2.4.18-27.8.0)
View/Vote Developer Edit Submission

[30 Sep 2003 11:15am UTC] stephen dot irven at britishwaterways dot co dot uk
Description:
------------
When configuring PHP 4.3.3 --with-regex=system , it appears to use the
PHP builtin regex regardless (phpinfo() shows "Bundled library
enabled").

[The reason I'm trying to use system regex is that PHPMapscript
(http://mapserver.gis.umn.edu/doc/phpmapscript-install-howto.html)
currently requires it in order to get around a bug in their software]

I have done a search, and found a few reports of similar problems, but
no solutions yet.

Setup:

PHP: 4.3.3
Apache: 2.0.47
Linux kernel: 2.4.18-27.8.0
OpenSSL: 0.9.7b

PHP configuration:

./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql
--with-curlwrappers --with-openssl=/usr --with-gd --enable-gd-native-ttf
--enable-ftp --with-zlib-dir=/usr/lib --with-regex=system

phpinfo() output can be seen at:
http://experience.british-waterways.com/
showing configuration options, and regex settings.

cheers,

[2 Oct 2003 12:01pm UTC] sniper@php.net
That phpmapscript module should be rewritten.
(seems like it's written for PHP 3?!)

When you build PHP with Apache1/2, it will ALWAYS default
to php provided regex otherwise it won't compile.

[3 Oct 2003 11:05am UTC] morissette at dmsolutions dot ca
Sniper,

I'm the developer of PHP MapScript and we need to find a solution to
this issue and not just blame the problem on the extension which is not
a solution at all.  Why is it that when you compile PHP as an Apache
module it *MUST* use the builtin regex?  Can you please give me pointers
to docs or to a developer who could give me more details on the reasons
why PHP can't work with the system regex when compiled as an Apache
module?

The problem here is that PHP MapScript is based on other packages that
use the system regex. If we let PHP use its bundled regex and then let
mapscript use the system regex we end up with 2 different copies of
regex in the same process.  If both were 100% identical this would be no
problem, but they are not: they use the same function names, the same
regex_t struct name but with different sizes.  This situation often
leads to instability or crashes.  

The only solution then would be to  compile PHP MapScript using the
system regex, but doing this can be a real pain since PHP's regex is not
setup to be shared by external programs outside of PHP.  Before we try
to do that I need to understand why PHP can't use the system regex in
the first place

Note that this issue may affect any other module that uses regex, not
just mapscript, that's why it would be better to fix it in PHP than to
work around it in every other extension that uses regex.

Thanks in advance for your help.

P.S. For the record mapscript has its own bug about this:
http://mapserver.gis.umn.edu/bugs/show_bug.cgi?id=252

RSS feed | show source 

PHP Copyright © 2001-2009 The PHP Group
All rights reserved.
Last updated: Sat Nov 21 10:30:49 2009 UTC