ID: 25704 Comment by: morissette at dmsolutions dot ca Reported By: stephen dot irven at britishwaterways dot co dot uk Status: Bogus Bug Type: Regexps related Operating System: Redhat 8 (kernel 2.4.18-27.8.0) PHP Version: 4.3.3 New Comment:
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 Previous Comments: ------------------------------------------------------------------------ [2003-10-02 12:01:30] [EMAIL PROTECTED] 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-02 11:13:14] stephen dot irven at britishwaterways dot co dot uk Thanks, The SSL build problem is fixed in the latest csv, but the regex configuration issue remains. Is it possible that it's defaulting to the bundled regex as it can't find a correct system regex library (?) I had a trawl through the configure script, and experimented altering it to force it to "system", but got undefined references in browscap.c and reg.c to `php_regcomp', `php_regexec', `php_regfree',`php_regerror' which led me to suspect that it's ignoring the system regex option for a reason. cheers, ------------------------------------------------------------------------ [2003-10-01 23:16:22] [EMAIL PROTECTED] Grab the latest snapshot now, the SSL build problem is fixed. ------------------------------------------------------------------------ [2003-10-01 04:56:01] stephen dot irven at britishwaterways dot co dot uk Thanks, I tried using the latest cvs (.tar.gz), but have been unable to get it to compile. Any attempt to make the latest cvs gives a number of undefined references in network.c relating to SSL (see http://experience.british-waterways.com/php4-stable-make.txt ). This is the case even with a minimal ./configure with no options (ie not including openSSL) The same configure lines work perfectly with 4.3.3 ... (corrected zlib entry) Cheers, ------------------------------------------------------------------------ [2003-09-30 14:34:15] [EMAIL PROTECTED] And FYI: --with-zlib-dir=/usr/lib is wrong, it should not contain /lib in it. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/25704 -- Edit this bug report at http://bugs.php.net/?id=25704&edit=1