Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 8.1-rc5 fail with any preg_*() function #1680

Closed
1 task done
joanhey opened this issue Nov 10, 2021 · 12 comments
Closed
1 task done

PHP 8.1-rc5 fail with any preg_*() function #1680

joanhey opened this issue Nov 10, 2021 · 12 comments

Comments

@joanhey
Copy link

joanhey commented Nov 10, 2021

Frequently asked questions

Describe the bug

All preg_*() functions fail with:
Compilation failed: unrecognised compile-time option bit(s) at offset 0 in file ...

Almost with preg_match(), preg_match_all(), preg_split() and preg_replace().

It's failing with all the php frameworks in https://github.com/TechEmpower/FrameworkBenchmarks

To Reproduce
Steps to reproduce the behavior:

Use this docker file:
https://github.com/TechEmpower/FrameworkBenchmarks/blob/fe90508e82feb91a0bb72e94e75865609517b2b1/frameworks/PHP/php/php.dockerfile

And try to use any preg_*() function.

With php 8.0 is working without problems.

Distribution (please complete the following information):

  • OS: Docker with Ubuntu 20.04
  • Architecture: amd64
  • Repository: Ubuntu PPA
@oerdnj
Copy link
Owner

oerdnj commented Nov 11, 2021

Seems like dup of #1674 to me.

@oerdnj oerdnj closed this as completed Nov 11, 2021
@joanhey
Copy link
Author

joanhey commented Nov 11, 2021

Don't look like a php bug.

It's working in https://3v4l.org/rJvkX#v8.1rc3 and with any docker image php:8.1-rc.

Only fail when using these packages.

Extra info: when php8.1-dev is installed the preg_*() has no errors.

@oerdnj
Copy link
Owner

oerdnj commented Nov 11, 2021

Have you actually read the other issue? Especially the part about pcre2 libraries?

@joanhey
Copy link
Author

joanhey commented Nov 11, 2021

Yes, but it's only necessary to add php8.1-dev and it will work without problems. Without update the pcre2 libs.

But why with php8.1-dev is working and not with only php-8.1 or php8.1-common

@oerdnj
Copy link
Owner

oerdnj commented Nov 11, 2021

What are the pcre2 library versions on system where it works and what are the versions where it doesn't?

@oerdnj
Copy link
Owner

oerdnj commented Nov 11, 2021

E.g. is you system fully upgraded when you are testing the issue?

@sleemanj
Copy link

sleemanj commented Nov 11, 2021

The dockerfile does not do an upgrade, only an update, that will be your problem @joanhey the focal tarball that the docker image is constructed from (as I understand it) was generated way back on the 6/7th of October.

I don't use docker, but I just spun up a fresh 20.04 EC2 instance, an initial update & upgrade brings in

The following packages will be upgraded:
   libargon2-1 libidn2-0 libpcre2-8-0 libpcre3 libxml2 libzstd1

And 8.1 CLI works...

$ php8.1 -r "echo preg_replace('/fubar/', 'hello world', ' fubar ');"
hello world

@joanhey
Copy link
Author

joanhey commented Nov 11, 2021

Using inside a docker with ubuntu:20.04:

Update the docker file to use php8.1:
joanhey/FrameworkBenchmarks@8819d83

And appear these errors:
https://github.com/joanhey/FrameworkBenchmarks/runs/4176964544?check_suite_focus=true#step:9:799

Add php8.1-dev, without update pcre libs:
joanhey/FrameworkBenchmarks@a453b6d

and it don't have errors:
https://github.com/joanhey/FrameworkBenchmarks/runs/4177163628?check_suite_focus=true#step:9:800

That happens with all frameworks.
Using docker php:8.1-rc is working OK, but NOT when using the ppa:ondrej/php with ubuntu:20.04 without the php8.1-dev.

@sleemanj
Copy link

@joanhey
Copy link
Author

joanhey commented Nov 11, 2021

Yes, but php8.1-dev update the pcre libs (I think).

But not when using only php8.1 or php8.1-common (Why ?).

@oerdnj
Copy link
Owner

oerdnj commented Nov 11, 2021

Did you come for help or to argue? I can't tell anymore...

@joanhey
Copy link
Author

joanhey commented Nov 11, 2021

I try to help.

I understand that the correct way will be to upgrade the docker.

But if php8.1 update the pcre libs, like do php8.1-dev. Nobody will ask for this question again.

Thank you for your hard work and sorry for use your time.

Repository owner locked as resolved and limited conversation to collaborators Nov 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants