php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25704 Configuration issue with regex
Submitted: 2003-09-30 11:15 UTC Modified: 2003-10-02 12:01 UTC
From: stephen dot irven at britishwaterways dot co dot uk Assigned:
Status: Not a bug Package: Regexps related
PHP Version: 4.3.3 OS: Redhat 8 (kernel 2.4.18-27.8.0)
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: stephen dot irven at britishwaterways dot co dot uk
New email:
PHP Version: OS:

 

 [2003-09-30 11:15 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,


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-10-02 12:01 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.


 [2003-10-03 11:05 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
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Thu Dec 03 08:01:23 2020 UTC