php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78197 PCRE2 version check in `configure` fails for "##.##-xxx" version strings
Submitted: 2019-06-22 18:38 UTC Modified: 2019-06-23 11:20 UTC
From: pgnet dot dev at gmail dot com Assigned:
Status: Closed Package: Compile Failure
PHP Version: 7.3.6 OS: linux64
Private report: No CVE-ID: None
 [2019-06-22 18:38 UTC] pgnet dot dev at gmail dot com
Description:
------------
Building PHP 7.3 against PCRE2/git

	which pcre2-config
		/usr/local/bin/pcre2-config
	pcre2-config --version
		10.34-RC1

php configure fails

	...
	checking for PCRE2 10.30 or greater... ./configure: line 19557: test: 1034-RC1: integer expression expected
	...

in 'configure',

           ...
           PCRE2_CONF=$PHP_PCRE_REGEX/bin/pcre2-config
             ...
             PCRE2_VER=`$PCRE2_CONF --version`
19557        if test "`echo $PCRE2_VER | sed 's,\.,,g'`" -lt 1030; then
             ...

The problem's in the PCRE2 version string -- the configure step chokes on the "-RC1" in its version test.

-	19557        if test "`echo $PCRE2_VER | sed 's,\.,,g'`" -lt 1030; then
+	19557        if test "`echo $PCRE2_VER | sed 's,-.*,,g' | sed 's,\.,,g'`" -lt 1030; then


does the trick

	...
	checking for PCRE2 10.30 or greater... 10.34-RC1
	...


Patches

Pull Requests

Pull requests:

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-06-23 11:20 UTC] cmb@php.net
Thanks!  The fix would go to config0.m4[1].  I'm not sure whether
we should apply the fix, though, since PHP 7.4 dropped support for
pcre2-config in favor of pkg-config which is already supported by
PHP 7.3.  So having a properly pgk-config would be necessary in
the near future anyway.

[1] <https://github.com/php/php-src/blob/php-7.3.6/ext/pcre/config0.m4#L38>
 [2019-06-23 13:57 UTC] peterkokot at gmail dot com
The following pull request has been associated:

Patch Name: Fix bug #78197: PCRE2 version check
On GitHub:  https://github.com/php/php-src/pull/4296
Patch:      https://github.com/php/php-src/pull/4296.patch
 [2019-06-23 14:14 UTC] peterkokot at gmail dot com
Above pull request should fix this. PHP 7.3 and PCRE already use pkg-config otherwise...
 [2019-07-01 00:55 UTC] petk@php.net
Automatic comment on behalf of peterkokot@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=624488b5e82545f6424998fa66d6bb0f143f81c0
Log: Fix bug #78197: PCRE2 version check
 [2019-07-01 00:55 UTC] petk@php.net
-Status: Open +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Nov 08 15:01:30 2024 UTC