php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34921 Compilation Error: #include "pcrelib/pcre.h" missing from ext/pcre/php_pcre.c
Submitted: 2005-10-19 23:34 UTC Modified: 2005-10-29 01:00 UTC
Votes:3
Avg. Score:3.7 ± 1.2
Reproduced:3 of 3 (100.0%)
Same Version:2 (66.7%)
Same OS:1 (33.3%)
From: davidgregorymail at yahoo dot com Assigned:
Status: No Feedback Package: PCRE related
PHP Version: 4.4.0 OS: Red Hat Enterprise 3 AS Update 6
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: davidgregorymail at yahoo dot com
New email:
PHP Version: OS:

 

 [2005-10-19 23:34 UTC] davidgregorymail at yahoo dot com
Description:
------------
Hello,

Simple Compilation Error for pcre.

#include "pcrelib/pcre.h" missing from php-4.4.0/ext/pcre/php_pcre.c

Insert include and compilation works...

Sincerely,
Dave Gregory


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-10-19 23:45 UTC] tony2001@php.net
It is in ext/pcre/php_pcre.h.
What error do you get and how exactly did you ./configure your build ?
 [2005-10-20 00:02 UTC] davidgregorymail at yahoo dot com
./configure '--host=i386-redhat-linux' '--build=i386-redhat-linux' '--target=i386-redhat-linux-gnu' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include'
'--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man'
'--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--enable-force-cgi-redirect' '--disable-debug' '--enable-pic' '--disable-rpath' '--enable-inline-optimization' '--with-bz2' '--with-db4=/usr' '--with-curl' '--with-dom=/usr' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-gd' '--enable-gd-native-ttf' '--with-ttf' '--with-gettext' '--with-ncurses' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-pspell' '--with-regex=system' '--with-xml' '--with-expat-dir=/usr' '--with-pcre-regex=/usr' '--with-zlib' '--with-layout=GNU' '--enable-bcmath' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-safe-mode' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-discard-path' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--enable-mbstring' '--enable-mbstr-enc-trans' '--enable-mbregex' '--with-pear=/usr/share/pear' '--with-imap=shared' '--with-imap-ssl' '--with-kerberos=/usr/kerberos' '--with-ldap=shared' '--with-mysql=shared,/usr' '--with-pgsql=shared' '--with-unixODBC=shared' '--enable-memory-limit' '--enable-bcmath' '--enable-shmop'
'--enable-versioning' '--enable-calendar' '--enable-dbx' '--enable-dio' '--enable-mcal' '--with-apxs2filter=/usr/sbin/apxs'
 [2005-10-20 00:07 UTC] tony2001@php.net
Now remove all this stuff except for the one option:
'--with-pcre-regex=/usr'
And try again.
Also, tell me where exactly your pcre.h is and what error do you get.
 [2005-10-20 00:07 UTC] davidgregorymail at yahoo dot com
/bin/sh /root/php-4.4.0/libtool --silent --preserve-dup-deps --mode=compile gcc -DSUPPORT_UTF8 -DSUPPORT_UCP -DLINK_SIZE=2 -DPOSIX_MALLOC_THRESHOLD=10 -DMATCH_LIMIT=10000000 -Iext/pcre/ -I/root/php-4.4.0/ext/pcre/ -DPHP_ATOM_INC -I/root/php-4.4.0/include -I/root/php-4.4.0/main -I/root/php-4.4.0 -I/usr/kerberos/include -I/usr/include/libxml2 -I/usr/include/freetype2 -I/usr/include/imap -I/root/php-4.4.0/ext/mbstring/mbregex -I/root/php-4.4.0/ext/mbstring/libmbfl -I/root/php-4.4.0/ext/mbstring/libmbfl/mbfl -I/usr/include/mysql -I/usr/include/ncurses -I/usr/include/pcre -I/usr/include/pspell -I/root/php-4.4.0/TSRM -I/root/php-4.4.0/Zend    -g -O2  -prefer-non-pic -c /root/php-4.4.0/ext/pcre/php_pcre.c -o ext/pcre/php_pcre.lo
/root/php-4.4.0/ext/pcre/php_pcre.c: In function `php_pcre_match':
/root/php-4.4.0/ext/pcre/php_pcre.c:452: `PCRE_INFO_NAMECOUNT' undeclared (first use in this function)
/root/php-4.4.0/ext/pcre/php_pcre.c:452: (Each undeclared identifier is reported only once
/root/php-4.4.0/ext/pcre/php_pcre.c:452: for each function it appears in.)
/root/php-4.4.0/ext/pcre/php_pcre.c:460: `PCRE_INFO_NAMETABLE' undeclared (first use in this function)
/root/php-4.4.0/ext/pcre/php_pcre.c:461: `PCRE_INFO_NAMEENTRYSIZE' undeclared (first use in this function)
make: *** [ext/pcre/php_pcre.lo] Error 1
[root@dg4-clone php-4.4.0]#
 [2005-10-20 00:12 UTC] davidgregorymail at yahoo dot com
Ok... Here's the ./configure '--with-pcre-regex=/usr'
...

gcc -DSUPPORT_UTF8 -DSUPPORT_UCP -DLINK_SIZE=2 -DPOSIX_MALLOC_THRESHOLD=10 -DMATCH_LIMIT=10000000 -Iext/pcre/ -I/root/php-4.4.0/ext/pcre/ -DPHP_ATOM_INC -I/root/php-4.4.0/include -I/root/php-4.4.0/main -I/root/php-4.4.0 -I/usr/include/pcre -I/root/php-4.4.0/ext/xml/expat -I/root/php-4.4.0/TSRM -I/root/php-4.4.0/Zend    -g -O2  -c /root/php-4.4.0/ext/pcre/php_pcre.c -o ext/pcre/php_pcre.o  && echo > ext/pcre/php_pcre.lo
/root/php-4.4.0/ext/pcre/php_pcre.c: In function `php_pcre_match':
/root/php-4.4.0/ext/pcre/php_pcre.c:452: `PCRE_INFO_NAMECOUNT' undeclared (first use in this function)
/root/php-4.4.0/ext/pcre/php_pcre.c:452: (Each undeclared identifier is reported only once
/root/php-4.4.0/ext/pcre/php_pcre.c:452: for each function it appears in.)
/root/php-4.4.0/ext/pcre/php_pcre.c:460: `PCRE_INFO_NAMETABLE' undeclared (first use in this function)
/root/php-4.4.0/ext/pcre/php_pcre.c:461: `PCRE_INFO_NAMEENTRYSIZE' undeclared (first use in this function)
make: *** [ext/pcre/php_pcre.lo] Error 1
[root@dg4-clone php-4.4.0]#
 [2005-10-20 00:21 UTC] tony2001@php.net
What version of PCRE do you have in your system ?
Are you sure your pcre.h contains those defines ?
 [2005-10-20 16:44 UTC] davidgregorymail at yahoo dot com
Hi,

It's the standard red hat enterprise 3 update 6 packages.  Here's the info from the rpm database on packages

pcre-devel-3.9-10.2
pcre-3.9-10.2


 
Name        : pcre                         Relocations: /usr
Version     : 3.9                               Vendor: Red Hat, Inc.
Release     : 10.2                          Build Date: Fri 19 Aug 2005 08:12:36 AM CDT
Install Date: Tue 04 Oct 2005 08:04:37 AM CDT      Build Host: porky.build.redhat.com
Group       : System Environment/Libraries   Source RPM: pcre-3.9-10.2.src.rpm
Size        : 78452                            License: GPL
Signature   : DSA/SHA1, Tue 30 Aug 2005 12:25:15 PM CDT, Key ID 219180cddb42a60e
Packager    : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>
URL         : http://www.pcre.org/
Summary     : Perl-compatible regular expression library.
Description :
Perl-compatible regular expression library. PCRE has its own native
API, but a set of "wrapper" functions that are based on the POSIX API
are also supplied in the library libpcreposix. Note that this just
provides a POSIX calling interface to PCRE; the regular expressions
themselves still follow Perl syntax and semantics. The header file for
the POSIX-style functions is called pcreposix.h.
/lib/libpcre.so.0
/lib/libpcre.so.0.0.1
/usr/bin/pcregrep
/usr/bin/pcretest
/usr/lib/libpcreposix.so.0
/usr/lib/libpcreposix.so.0.0.0
/usr/share/man/man1/pcregrep.1.gz
/usr/share/man/man1/pcretest.1.gz




Name        : pcre-devel                   Relocations: /usr
Version     : 3.9                               Vendor: Red Hat, Inc.
Release     : 10.2                          Build Date: Fri 19 Aug 2005 08:12:36 AM CDT
Install Date: Tue 04 Oct 2005 08:45:48 AM CDT      Build Host: porky.build.redhat.com
Group       : Development/Libraries         Source RPM: pcre-3.9-10.2.src.rpm
Size        : 85594                            License: GPL
Signature   : DSA/SHA1, Tue 30 Aug 2005 12:25:15 PM CDT, Key ID 219180cddb42a60e
Packager    : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>
URL         : http://www.pcre.org/
Summary     : Development files for pcre.
Description :
Development files (Headers, libraries for static linking, etc) for pcre.
/usr/bin/pcre-config
/usr/include/pcre
/usr/include/pcre/pcre.h
/usr/include/pcre/pcreposix.h
/usr/lib/libpcre.a
/usr/lib/libpcre.so
/usr/lib/libpcreposix.a
/usr/lib/libpcreposix.so
/usr/share/man/man3/pcre.3.gz
/usr/share/man/man3/pcreposix.3.gz
 [2005-10-20 19:33 UTC] tony2001@php.net
Are you sure your pcre.h contains those defines ?
 [2005-10-20 22:46 UTC] davidgregorymail at yahoo dot com
Here's a search for those variable names: PCRE_INFO_NAMETABLE| PCRE_INFO_NAMEENTRYSIZE| PCRE_INFO_NAMECOUNT

/root/php-4.4.0

[ php-4.4.0]# find . -print | grep \.h$ | xargs egrep -H 'PCRE_INFO_NAMETABLE|PCRE_INFO_NAMEENTRYSIZE|PCRE_INFO_NAMECOUNT'
./ext/pcre/pcrelib/pcre.h:#define PCRE_INFO_NAMEENTRYSIZE      7
./ext/pcre/pcrelib/pcre.h:#define PCRE_INFO_NAMECOUNT          8
./ext/pcre/pcrelib/pcre.h:#define PCRE_INFO_NAMETABLE          9
[ php-4.4.0]# find . -print | grep pcre | grep \.h$
./ext/pcre/php_pcre.h
./ext/pcre/pcrelib/internal.h
./ext/pcre/pcrelib/pcreposix.h
./ext/pcre/pcrelib/ucp.h
./ext/pcre/pcrelib/pcre.h
./ext/pcre/pcrelib/ucpinternal.h
[php-4.4.0]#
 [2005-10-21 22:58 UTC] tony2001@php.net
Take a look at your ./configure line:
'--with-pcre-regex=/usr'

You're using *external* PCRE library (not the one bundled with PHP, but the one distributed with your distro).
Actually, I'd call it pointless unless you know what you're doing, but it shouldn't cause any problems.
I was asking you about pcre.h because I'm not sure you have pcre-devel package installed correctly. I know that PHP's PCRE contains all those defines, but I would like to know if those defines are in your system's pcre.h (i.e. /usr/include/pcre/pcre.h) to be sure that it really doesn't get included. 
Thanks.
 [2005-10-29 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2007-09-29 20:31 UTC] perldork at webwizarddesign dot com
To answer your question:

On RHEL Enterprise 3, /usr/include/pcre/pcre.h does not have

PCRE_INFO_NAMECOUNT

defined.  He, like me, is probably doing a custom recompile using the base configure options from phpinfo() and adding additional ones (SNMP support in my case) .. the RHEL phpinfo() does include the

'--with-pcre-regex=/usr' 

line, so undersandable that this would be confusing :).

And yes, removing the configure line did allow configure/make to continue beyond that point.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 16:01:28 2024 UTC