Php5 + Pcre

liunx

Guest
When I try to use preg_match(), I get this...

Fatal error: Call to undefined function preg_match() in
/usr/home/www/library/defines.php on line 25

Apperantly this happen with all preg_* functions.

Any idea?

-----------------
Error line
-----------------

if (!preg_match('@([0-9]{1,2}).([0-9]{1,2}).([0-9]{1,2})@',
phpversion(), $match))

-----------------
Environment
-----------------

FreeBSD 4.10-STABLE
PHP 5.0.0
Apache 1.3.31
MySQL 4.0.20

-----------------
PHP Configure
-----------------

--enable-versioning
--enable-memory-limit
--with-layout=GNU
--disable-all
--enable-libxml
--with-libxml-dir=/usr/local
--enable-spl
--with-regex=php
--disable-cli
--with-apxs=/usr/local/sbin/apxs
--disable-ipv6
--prefix=/usr/localI was under the impression PHP 5 was built in PCRE support but you may find this informative

<!-- m --><a class="postlink" href="http://www.php.net/manual/en/ref.pcre.php">http://www.php.net/manual/en/ref.pcre.php</a><!-- m --> seems weird that its compiled in with PHP 4. Ive never personally had a problem with itMy install does not produce the same error. Might be a libraries issue.

My environment:
FreeBSD 4.10-STABLE
PHP 5.0.0
Apache 2.0.50
MySQL 4.0.20

My config script:
./configure \
--with-apxs2=/usr/local/apache2/bin/apxs \
--disable-cgi \
--enable-safe-mode \
--enable-magic-quotes \
--disable-short-tags \
--enable-versioning \
--with-libxml-dir=/usr/local \
--with-openssl=/usr \
--with-zlib \
--enable-bcmath \
--with-bz2 \
--enable-calendar \
--enable-exif \
--with-gd \
--with-jpeg-dir=/usr/local \
--with-png-dir=/usr/local \
--with-freetype-dir=/usr/local \
--enable-gd-native-ttf \
--with-iconv=/usr/local \
--with-mcrypt=/usr/local \
--with-mssql=/usr/local \
--with-mysql=/usr/local/mysql \
--with-pgsql=/usr/local/pgsql \
--with-pspell=/usr/local \
--enable-sockets \
--enable-sqlite-utf8 \
--with-xsl=/usr/local


One thing you might consider trying: take out the --with-regex=php line in your configure statement.It worked when I added:

--with-pcre-regex=yes


Silly it's not default builtin, like in PHP4 and earlier.
 
Back
Top