php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1048 ereg_replace does not work
Submitted: 1999-01-08 18:29 UTC Modified: 1999-01-10 00:23 UTC
From: yzhang at sfu dot ca Assigned:
Status: Closed Package: Other
PHP Version: 3.0.5 OS: Linux (2.0.36)
Private report: No CVE-ID: None
 [1999-01-08 18:29 UTC] yzhang at sfu dot ca
When I use ereg_replace in a script, the browser returns with an error message while accessing the page.

I used the Apache-1.3.3.i386.rpm that comes with Redhat 5.2, and I compiled PHP 3.0.5 as follows:

$ tar -zxf php-3.0.5.tar.gz
$ cd php-3.0.5
$ ./configure \
        --with-apxs \
        --prefix=/usr \
        --with-gd \
        --with-zlib \
        --with-config-file-path=/etc/httpd/conf \
        --disable-debug \
        --enable-magic-quotes \
        --enable-debugger \
        --enable-bcmath \
        --enable-track-vars \
        --with-dbase \
        --with-mysql=/usr/local/mysql
$ make -C regex
$ make
$ strip libphp3.so
$ install -m755 libphp3.so /usr/lib/apache/mod_php3.so
$ install -m644 php3.ini-dist /etc/httpd/conf/php3.ini
$ install -m644 extra/icons/*.gif /home/httpd/icons

any call to ereg_replace will reproduce this on my system, eg:

<?
  echo ereg_replace("a", "b", "bababa");
?>

i was able to resolve the problem by adding the switch
--with-system-regex
to the configure script (and not running make -C regex).

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-01-10 00:23 UTC] rasmus
Sounds like you discovered the problem on your own.  Apache was linked against the system regex and when you switched PHP to use that as well everything worked.  
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 09 23:01:32 2024 UTC