Fatal Error Call To Undefined Function Preg_replace
Contents |
pages and found this error in my web server logs: "PHP Fatal error: Call to undefined function preg_replace() in /path/to/file.php" call to undefined function preg_match_replace This is not a terribly difficult problem and people with PHP experience
Preg Replace Callback
are probably already yelling: "PCRE!" at the screen. :) (That stands for Perl Compatible Regular Expressions.") I only
String Replace
write this post because the web search of this error did not give an obvious answer in the first couple of hits.If you're in FreeBSD, the solution is simple: install the port "devel/php5-pcre" (or "devel/php4-pcre" as appropriate). Do that from the ports tree by changing to the directory "/usr/ports/devel/php5-pcre" and typing "make install" as root. Or, you could just run "pkg_add -r php5-pcre" (as root). If it's already installed, then reinstall it from the ports tree. Then you'll probably have to restart your web server as well.While I usually try to avoid editorializing, it seems to me like the PCRE extension ought to be part of the standard library in PHP by now! (Does PHP have a standard library? I tend to think in python. :) )Labels: www
posted by kace @ 15:39 1 comments 1 Comments: At 22/7/10 04:58, lapo said... Indeed /usr/ports/MOVED reports:devel/php5-pcre|lang/php5|2010-04-09|Bundled in core php Post a Comment << Home about me name: kace location: /usr/home I've been using FreeBSD since release release 3.2 and have been loving every minute of it. my blogger profile Topics advocacy bash desktop servers ports installing ipfw ntp Recent Posts 403 4.7.0 TLS handshake failed An FTP error and fix Drop down link menu, script-free! Quick enable passwords for svnserve X on FreeBSD amd64 gotbsd.net: technical difficulties ... resolved Waiting for box to come back bash history grep alias "Error ... ../php.vim" Update Cool board games The bookshelf Enter your search terms Web BSDpants Submit search form Other Links Burbatory can be amusing. © 2006-2011[NEW]: Call to undefined function preg_replace() - PHP Bugs From: mirko dot viviani at gmail dot com Operating system: FreeBSD 6.2-STABLE PHP version: 5.2.1 PHP Bug Type: *Regular Expressions Bug description: Call to undefined function preg_replace() Description: ------------ I have installed php5 with apache22 support from freebsd-ports, configured with this arg: --with-regex=apache It does not seem http://bsdpants.blogspot.com/2010/06/call-to-undefined-function-pregreplace.html to include the preg_replace() function: [Tue Mar 06 20:18:13 2007] [error] [client x] PHP Fatal error: Call to undefined function preg_replace() in /usr... -- Edit bug report at [url]http://bugs.php.net/?id=40742&edit=1[/url] -- Try a CVS snapshot (PHP 4.4): [url]http://bugs.php.net/fix.php?id=40742&r=trysnapshot44[/url] Try a CVS snapshot (PHP 5.2): [url]http://bugs.php.net/fix.php?id=40742&r=trysnapshot52[/url] Try http://www.justskins.com/forums/40742-new-call-to-143105.html a CVS snapshot (PHP 6.0): [url]http://bugs.php.net/fix.php?id=40742&r=trysnapshot60[/url] Fixed in ... Thread Tools Show Printable Version Email this Page… Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode March 6th,09:01 PM #1 #40742 [NEW]: Call to undefined function preg_replace() From: mirko dot viviani at gmail dot com Operating system: FreeBSD 6.2-STABLE PHP version: 5.2.1 PHP Bug Type: *Regular Expressions Bug description: Call to undefined function preg_replace() Description: ------------ I have installed php5 with apache22 support from freebsd-ports, configured with this arg: --with-regex=apache It does not seem to include the preg_replace() function: [Tue Mar 06 20:18:13 2007] [error] [client x] PHP Fatal error: Call to undefined function preg_replace() in /usr... -- Edit bug report at [url]http://bugs.php.net/?id=40742&edit=1[/url] -- Try a CVS snapshot (PHP 4.4): [url]http://bugs.php.net/fix.php?id=40742&r=trysnapshot44[/url] Try a CVS snapshot (PHP 5.2): [url]http://bugs.php.net/fix.php?id=40742&r=tr
your question and get tips & solutions from a community of 418,550 IT Pros & Developers. It's quick https://bytes.com/topic/php/answers/13018-preg_replace-function-doesnt-work-help & easy. preg_replace function doesn't work. HELP! P: n/a Ruslan V. Sulakov The situation: root@oasis2# cat test.php ; echo "---------"; php test.php --------- PHP Fatal error: Call to undefined function: preg_replace() in /home/ruslan/oasis/oasis/test.php on line 6 root@oasis2# call to Any help is apriciated! Thanks in advance! Ruslan ------------- PHP-4.3.5 FreeBSD-5.4 Jul 17 '05 #1 Post Reply Share this Question 2 Replies P: n/a Erwin Moller Ruslan V. Sulakov wrote: The situation: root@oasis2# cat test.php ; echo "---------"; php test.php --------- PHP Fatal error: Call to undefined function: preg_replace() in /home/ruslan/oasis/oasis/test.php on line 6 root@oasis2# Any help is apriciated! Thanks in advance! Ruslan ------------- PHP-4.3.5 FreeBSD-5.4 Hi, Did you compile it yourself? Maybe you forgot the PCRE extensions?? If so: recompile php and compile the regular expression engine into it. And when you are busy doing, why not take a newer version? Good luck. Regards, Erwin Moller Jul 17 '05 #2 P: n/a Erwin Moller Sorry, I forgot to pass a usefull url: http://nl2.php.net/pcre Good luck. Regards, Erwin Moller Jul 17 '05 #3 This discussion thread is closed Start new discussion Replies have been disabled for this discussion. Similar topics preg_replace problem - please help preg_replace backreferencing problem [regex] Why doesn't preg_replace work? Help Regular Expressions preg_replace preg_replace question The preg_replace limit and arrays. preg_replace: stripping backslashes please help with preg_replace how to get rid of extra new lines? I've tried so many ways preg_replace help Browse more PHP Questions on Bytes Question stats viewed: 5980 re