php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #81640 preg_match compilation fails after upgrade from 7.4.25 to 7.4.26
Submitted: 2021-11-19 16:02 UTC Modified: 2021-11-22 11:43 UTC
Votes:22
Avg. Score:4.7 ± 0.6
Reproduced:22 of 22 (100.0%)
Same Version:18 (81.8%)
Same OS:16 (72.7%)
From: calvet dot thomas at gmail dot com Assigned: cmb (profile)
Status: Not a bug Package: PCRE related
PHP Version: 7.4.26 OS: Ubuntu
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: calvet dot thomas at gmail dot com
New email:
PHP Version: OS:

 

 [2021-11-19 16:02 UTC] calvet dot thomas at gmail dot com
Description:
------------
Hello, after upgrading from PHP 7.4.25 to PHP 7.4.26 on my servers, preg_match and preg_match_all compilation started to fail with the following error message: "PHP Warning:  preg_match_all(): Compilation failed: unrecognised compile-time option bit(s) at offset 0".
To resolve it I had to upgrade the libpcre2-8-0 package. The libpcre2-8-0 was at "version" 10.36, I upgraded it to "version" 10.39.


Test script:
---------------
preg_match('/abc/', 'foo');


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-11-19 17:22 UTC] cmb@php.net
There is a respective downstream bug report[1].  Not sure which
one is not a bug. :)

[1] <https://github.com/oerdnj/deb.sury.org/issues/1682>
 [2021-11-20 22:28 UTC] phpbugs at icounsellor dot co dot uk
Thank you for posting this.

I too upgraded Debian (php7.4 to v 7.4.26) and experienced the same runtime failures:-

>> PHP message: PHP Warning:  preg_match(): Compilation failed: unrecognised compile-time option bit(s) at offset 0 in /home/sites/xxxxxxxx-redacted-xxxxxxx.php on line 235

Upgrading libpcre2-8-0 to version 10.36 (via Debian's testing distribution) solved my problems (yay!)

My guess: the PHP guys were expecting libpcre2-8-0 to have been upgraded to 10.36 in the stable channel but something hiccoughed/got out of sync.
 [2021-11-22 06:44 UTC] chamath dot gunasekara at gmail dot com
I'm also getting this error in my Gitlab php 7.4 image

PHP Warning:  preg_match(): Compilation failed: unrecognised compile-time option bit(s) at offset 0 in /builds/project_group/prj1/composer-setup.php on line 1076
Warning: preg_match(): Compilation failed: unrecognised compile-time option bit(s) at offset 0 in /builds/project_group/prj1/composer-setup.php on line 1076
Signature mismatch, could not verify the phar file integrity
The download failed repeatedly, aborting.
ERROR: Job failed: exit code 1

Today I got to know this issue. Please let us know how we can fix it.

Thanks
 [2021-11-22 08:51 UTC] mikijezi at gmail dot com
Hello, I was this problem on Ubuntu 20.04.1 LTS, upgrade libpcre2-8-0 solve problem. I used:

apt install --only-upgrade libpcre2-8-0
 [2021-11-22 11:43 UTC] cmb@php.net
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: cmb
 [2021-11-22 11:43 UTC] cmb@php.net
See <https://github.com/PhilipHazel/pcre2/issues/56>.  Long story
short: don't ever build with a newer version than you use at
runtime.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 16:01:28 2024 UTC