php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29158 Warning with preg_match
Submitted: 2004-07-14 19:07 UTC Modified: 2004-08-31 14:20 UTC
Votes:92
Avg. Score:4.9 ± 0.4
Reproduced:88 of 89 (98.9%)
Same Version:72 (81.8%)
Same OS:68 (77.3%)
From: admin at profvince dot com Assigned:
Status: Not a bug Package: PCRE related
PHP Version: 5.0.0 OS: Linux 2.6.6 - LFS 5.1pre1
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: admin at profvince dot com
New email:
PHP Version: OS:

 

 [2004-07-14 19:07 UTC] admin at profvince dot com
Description:
------------
--------------
Descritpiton :

I've just installed php-5.0.0, and I'm experiencing a warning with preg_match, related with PCRE, no matter the pattern or the string (especially on first page onf phpmyadmin).

Warning: preg_match: internal pcre_fullinfo() error -3 in [myscript] on line [line]

This error doesn't occur with PHP-5.0.0RC2 and PHP-5.0.0RC3 (and the same php configuration)

-------------
Environment :

LFS 5.1pre1
Linux 2.6.6
Apache 2.0.50 (with mpm=worker)
PCRE version 4.5 01-December-2003
Mysql 4.0.20

---------------
PHP configure :

./configure --with-apxs2=/usr/local/apache/bin/apxs --with-config-file-path=/etc/apache
--with-calendar
--with-pdf
--enable-trans-sid
--enable-mbstring
--enable-dbase
--with-dom
--with-sablot
--with-ttf
--enable-gd-imgstrttf
--enable-gd-native-ttf
--enable-bcmath
--with-bz2=/usr
--with-curl=/usr
--with-curlwrappers
--enable-exif
--enable-ftp
--with-gd=/usr
--with-freetype-dir=/usr
--with-gettext=/usr
--with-gmp=/usr
--with-ldap=/usr
--with-openssl=/usr
--with-mysql=/usr/local/mysql
--with-ncurses=/usr
--with-pcre-regex=/usr
--with-jpeg-dir=/usr
--with-png-dir=/usr
--with-zlib=/usr
--with-tiff-dir=/usr
--with-pspell=/usr
--with-libxml-dir=/usr
--with-openssl-dir=/usr
--enable-sockets
--with-libexpat-dir=/usr
--with-xsl=/usr
--enable-memory-limit
--enable-zend-multibyte

---------------------------
diff php.ini-dist php.ini :

197c197
< ;open_basedir =
---
> open_basedir = /srv/http
202c202
< disable_functions =
---
> disable_function = php_uname, putenv, getmyuid, getmypid, passthru, leak, listen, diskfreespace, tmpfile, link, ignore_user_abord, shell_exec, popen, dl, set_time_limit, exec, system, highlight_file, source, show_source, fpaththru, virtual, posix_ctermid, posix_getcwd, posix_getegid, posix_geteuid, posix_getgid, posix_getgrgid, posix_getgrnam, posix_getgroups, posix_getlogin, posix_getpgid, posix_getpgrp, posix_getpid, posix_getppid, posix_getpwnam, posix_getpwuid, posix_getrlimit, posix_getsid, posix_getuid, posix_isatty, posix_kill, posix_mkfifo, posix_setegid, posix_seteuid, posix_setgid, posix_setpgid, posix_setsid, posix_setuid, posix_times, posix_ttyname, posix_uname
378c378
< register_long_arrays = On
---
> register_long_arrays = Off
383c383
< register_argc_argv = On
---
> register_argc_argv = Off
386c386
< post_max_size = 8M
---
> post_max_size = 2M
443c443
< enable_dl = On
---
> enable_dl = Off
485c485
< ;upload_tmp_dir =
---
> upload_tmp_dir = /srv/http/upload
536d535
< 
596d594
< smtp_port = 25
640c638
< mysql.allow_persistent = On
---
> mysql.allow_persistent = Off
643c641
< mysql.max_persistent = -1
---
> mysql.max_persistent = 0
864c862
< ;session.save_path = "/tmp"
---
> session.save_path = "4;/srv/http/temp"
1171,1179d1168
< [soap]
< ; Enables or disables WSDL caching feature.
< soap.wsdl_cache_enabled=1
< ; Sets the directory name where SOAP extension will put cache files.
< soap.wsdl_cache_dir="/tmp"
< ; (time to live) Sets the number of second while cached file will be used 
< ; instead of original one.
< soap.wsdl_cache_ttl=86400

Reproduce code:
---------------
if (preg_match("/php/i", "PHP est le meilleur langage de script du web.")) {
   echo 'Un r?sultat a ?t? trouv?.';
} else {
   echo 'Aucun r?sultat n\'a ?t? trouv?.';
}

Expected result:
----------------
Un r?sultat a ?t? trouv?.

Actual result:
--------------
Warning: preg_match: internal pcre_fullinfo() error -3 in ..../test.php on line 3 [line of preg_match function]
Aucun r?sultat n'a ?t? trouv?.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-07-30 01:43 UTC] gaui at gaui dot is
Same problem here.
 [2004-07-30 01:55 UTC] gaui at gaui dot is
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

-----------------
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/local
 [2004-08-23 20:03 UTC] alexisdal at nospamplease dot hotmail dot com
Same problem here : 

Fatal error: Call to undefined function preg_match()


Error Line
----------
var_dump(preg_match("undefined", "this function is undefined"));


Config
------
PHP 5.0.0
FreeBSD 5.2.1-RELEASE


I'm kinda new to *nix setup and I could not reproduce the bug under windows. In the documentation about this (http://fr2.php.net/manual/en/ref.pcre.php), it says nothing needs to be setup in order to use the thing... ???
 [2004-08-25 07:20 UTC] ppanula at lapua dot net
I have same problem.

As far i can see, php 5.0.x uses it old pcre-routines. If you have your own pcre-installed it does not use them. You can check using phpinfo() and you can see it's old pcre even if you have never installed.
 [2004-08-25 22:47 UTC] webmaster at xphpx dot net
Same problem here with php 5.0.1
 [2004-08-31 14:06 UTC] alexis at nospamplz dot hotmail dot com
Just wanted to add that I tried it with PHP 5.0.1 and got the same issue.


Fatal error: Call to undefined function preg_match()

Error Line
----------
var_dump(preg_match("undefined", "this function is undefined"));

Config
------
PHP 5.0.1
FreeBSD 5.2.1-RELEASE
 [2004-08-31 14:20 UTC] tony2001@php.net
gaui at gaui dot is:
--disable-all disabled PCRE functions.
You have to add --with-pcre-regex to ./configure line.

alexis at nospamplz dot hotmail dot com:
Probably, same here. 
You just disabled yourself.

to all:
Do not use the bug system as a support forum.
Original problem has nothing to do with your configure issues.
Please, file separate bug reports next time (but search bug DB before).

Bogusifying the report. Please, if you still have any problems with preg_match - file another bug report with clear description of the problem. One bug - one report, plz.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Oct 21 08:01:23 2020 UTC