Mantis - php5
Viewing Issue Advanced Details
4520 packaging minor always 2010-08-13 16:38 2011-10-23 05:09
opk  
bwalton  
normal  
closed  
fixed  
none    
none  
0004520: mbregex missing from PHP
I'm attempting to migrate an application from blastwave stable to recent opencsw and I get the following message:
PHP Fatal error: Call to undefined function mb_ereg_replace

This can be reproduced easily with:
echo '<?php print mb_ereg_replace("a", "b", "lalala\n"); ?>' | /opt/csw/php5/bin/php

According to phpinfo(), php5 was compiled with --enable-mbregex=shared yet I can't find any shared library corresponding to mbregex. Has it perhaps been forgotten in the packaging. I do have mbstring and it is enabled in the configuration file. On the old installation, phpinfo() reports a bare --enable-mbregex.
Issue History
2010-08-13 16:38 opk New Issue
2011-01-03 13:47 sriedel Note Added: 0008656
2011-01-03 13:47 sriedel Issue Monitored: sriedel
2011-01-03 16:01 bwalton Note Added: 0008657
2011-01-03 16:15 sriedel Note Added: 0008658
2011-01-03 16:16 sriedel Note Edited: 0008658
2011-01-03 16:17 sriedel Note Edited: 0008658
2011-01-03 16:18 sriedel Note Edited: 0008658
2011-01-03 16:19 sriedel Note Edited: 0008658
2011-01-03 16:22 sriedel Note Edited: 0008658
2011-01-03 16:24 sriedel Note Edited: 0008658
2011-01-03 16:25 sriedel Note Edited: 0008658
2011-01-03 16:26 sriedel Note Edited: 0008658
2011-01-03 16:27 sriedel Note Edited: 0008658
2011-06-29 03:59 bwalton Status new => assigned
2011-06-29 03:59 bwalton Assigned To => bwalton
2011-06-29 04:09 bwalton Note Added: 0009157
2011-06-30 02:20 bwalton Note Added: 0009165
2011-06-30 03:49 bwalton Note Added: 0009166
2011-06-30 11:55 opk Note Added: 0009167
2011-06-30 13:55 sriedel Issue End Monitor: sriedel
2011-07-02 03:16 bwalton Note Added: 0009173
2011-10-23 05:09 bwalton Note Added: 0009361
2011-10-23 05:09 bwalton Status assigned => closed
2011-10-23 05:09 bwalton Resolution open => fixed

Notes
(0008656)
sriedel   
2011-01-03 13:47   
*bounce* I am waiting desperately for this issue to be resolved, but there seems to be no progress at all. Is there still hope that someone takes care of this issue?
(0008657)
bwalton   
2011-01-03 16:01   
Do you have php5_mbstring installed? I think it provides the functions you're missing.

HTH.
-Ben
(0008658)
sriedel   
2011-01-03 16:15   
(edited on: 2011-01-03 16:27)
Yep, php5_mbstring is installed, but mbregex is missing nevertheless.

Regarding to http://www.mail-archive.com/maintainers[AT]lists.opencsw.org/msg06843.html [^] (grrr ... replace [AT] by @ to make this link work ... this was needed due to horrible formatting of the URL by Mantis), mbregex is supposed to be in the main package php5, but was somehow left out when packaging it.

Anyways, thanks for your help.

(0009157)
bwalton   
2011-06-29 04:09   
The most recent test packages still exhibit this problem. mbstring is enabled and it seems mbregex is on by default. I'm still investigating but I likely won't have a fix before the pending release.
(0009165)
bwalton   
2011-06-30 02:20   
/* #undef HAVE_MBREGEX */

main/php_config.h doesn't define HAVE_MBREGEX, so we don't get that support. I'm now tracing why this doesn't get toggled on...
(0009166)
bwalton   
2011-06-30 03:49   
Seemingly something with their autoconf is messed up. Even though mbregex is supposed to be on by default, passing --enable-mbregex=shared was seeing it disabled. I've removed this argument to configure and am rebuilding it now.
(0009167)
opk   
2011-06-30 11:55   
A colleague of mine worked around the problem by recompiling the exact same version of PHP to get the mbregex module. He can't remember what he had to do with the configure options but he did somehow get it to build the module. This was a clean build without any of the gar stuff.
(0009173)
bwalton   
2011-07-02 03:16   
Solved by removing the --enable-mbregex=shared configure option. Testing appreciated: http://buildfarm.opencsw.org/experimental.html#php5 [^]

root @ r2 : /tmp
# pkgparam CSWphp5 VERSION
5.3.6,REV=2011.07.02

root @ r2 : /tmp
# which php
/opt/csw/bin/php

root @ r2 : /tmp
# cat test.php
<?php
        mb_internal_encoding("UTF-8");
        mb_regex_encoding("UTF-8");
        print mb_ereg_replace("a", "b", "lalala\n");
?>
root @ r2 : /tmp
# php ./test.php
lblblb
(0009361)
bwalton   
2011-10-23 05:09   
Updated packages released to dublin catalog.

-Ben