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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
31 - 14 = ?
Subscribe to this entry?

 
 [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

Pull Requests

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 Oct 31 23:01:28 2024 UTC