[PHP4BETA] PCRE problems
| From: | Daniel Landau | Date: | Wed, 12 Apr 2000 23:01:50 +0000 |
| Subject: | [PHP4BETA] PCRE problems | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-13478@lists.php.net to get a copy of this message | ||
I'm using the PCRE to perform some fairly heavy regexp work using
preg_replace with the e, i and s flags set in the search pattern, for
instance:
$pattern = '/(<IMG SRC=")([^"]+)"/eisU';
$html = preg_replace($pattern, "'\\1' . absoluteImage('\\2',
'$this->url',
'$server') . '\"'", $html);
I'm finding that SOMETIMES a series of this along with similar operations
generates this error:
FATAL: emalloc(): Unable to allocate 1077909393 bytes
[Wed Apr 12 13:04:05 2000] [notice] child pid 1361 exit signal Segmentation
fault (11)
At other times I encounter no problems. Sometimes turning off the 's' flag
on the pattern fixes the problem, at other times eliminating one or another
of the replace operations in the series fixes the problem. I'm baffled, and
hoping that someone can suggest a permanent fix.
Thanx,
-Daniel