php-5.0.5: Call to undefined function preg_replace error


Joined: 2004-04-07
Posts: 3
Posted: Sat, 2005-09-10 22:06

I'm running gentoo and am using apache, mysql and php from portage. I haven't been having any problems using gallery2 with this configuration until i upgraded to php-5.0.5 through portage and am now getting a basic fatal error: Fatal error: Call to undefined function preg_replace(). Is this a basic configuration issue on my part or is it indicative of a bug or other larger issue? I'm not much of a PHP guru, so I'm not really sure where to start to debug. Any help would be appreciated.

I tried to roll back to php 4.4, but dependencies within portage packages make it difficult.


Gallery URL:
Gallery version: 2.0-rc2
Webserver (with version): apache 2.0.54
Datatabase (with version): mysql 5.0.12
PHP version (eg 4.2.1): 5.0.5
phpinfo URL (optional):
Graphics Toolkit(s):
Operating system: gentoo linux
Web browser/version:
G1 version (for migration bugs):


Joined: 2003-01-04
Posts: 32509
Posted: Sat, 2005-09-10 22:55

should be available in php 5. also, we tested g2 with php 5.0.x and it works.

-> available in php 5.

special in your configuration is: "--without-pcre-regex"
you also have no pcre section in your phpinfo.

what i'd try:
change your gentoo emerge USE flags or override them just for php. and then emerge again (=recompile with new compile options, according to use flags).


Joined: 2004-04-07
Posts: 3
Posted: Sun, 2005-09-11 02:48

worked great - thanks for the tip.

I didn't have to set pcre as a USE flag before switching to PHP 5 in portage, so maybe they changed the default ebuild configuration.

Thanks again.


Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2005-09-11 10:19

and i didn't know we'd get an error if the PCRE use flag isn't compiled into G2.
i guess we'll have to add a system check for that in the system checks step of the installer / upgrader.

thanks for reporting!