Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Redis6Proxy incompatible with phpredis #57884

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

Closed
111ypuk opened this issue Jul 30, 2024 · 5 comments
Closed

Redis6Proxy incompatible with phpredis #57884

111ypuk opened this issue Jul 30, 2024 · 5 comments

Comments

@111ypuk
Copy link

111ypuk commented Jul 30, 2024

Symfony version(s) affected

7.1

Description

After update phpredis/phpredis@6ea5b3e

Get error:

 Declaration of Symfony\Component\Cache\Traits\Redis6Proxy::hSet($key, $member, $value): Redis|int|false must be compatible with Redis::hSet(string $key, mixed ...$fields_and_vals): Redis|int|false {"file":"/app/vendor/symfony/cache/Traits/Redis6Proxy.php","exception":"[object] (ErrorException(code: 0): Declaration of Symfony\\Component\\Cache\\Traits\\Redis6Proxy::hSet($key, $member, $value): Redis|int|false must be compatible with Redis::hSet(string $key, mixed ...$fields_and_vals): Redis|int|false at /app/vendor/symfony/cache/Traits/Redis6Proxy.php:519)"

How to reproduce

Create a symfony web project and inside it a Dockerfile with a php container which installs redis
...
FROM php:8.3.8-cli-alpine
...
RUN apk add --no-cache lz4-dev
&& mkdir /tmp/phpredis
&& cd /tmp/phpredis
&& git clone --recurse-submodules https://github.com/phpredis/phpredis "php-redis"
&& cd php-redis
&& phpize
&& ./configure --enable-redis-igbinary --enable-redis-lz4 --with-liblz4=/usr/lib
&& make
&& make install
&& make clean
&& docker-php-ext-enable redis
&& rm -rf /tmp/phpredis
...

Run the docker container and open the website

Possible Solution

No response

Additional Context

No response

@xabbuh
Copy link
Member

xabbuh commented Jul 30, 2024

Thank you for the report. Can you please check if #57885 would solve the issue that you experience?

@111ypuk
Copy link
Author

111ypuk commented Jul 30, 2024

Thank you for the report. Can you please check if #57885 would solve the issue that you experience?

yes

nicolas-grekas added a commit that referenced this issue Aug 7, 2024
…buh)

This PR was merged into the 6.4 branch.

Discussion
----------

[Cache] fix compatibility with redis extension 6.0.3+

| Q             | A
| ------------- | ---
| Branch?       | 6.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | Fix #57884
| License       | MIT

see the differences in the `redis.stub.php` and `redis_cluster.stub.php` files at phpredis/phpredis@6.0.2...develop

Commits
-------

fce4014 fix compatibility with redis extension 6.0.3+
fabpot added a commit that referenced this issue Sep 6, 2024
…edric-anne)

This PR was squashed before being merged into the 6.4 branch.

Discussion
----------

[Cache] Fix compatibility with Redis 6.1.0 pre-releases

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | Fix #57884
| License       | MIT

The solution provided in #57885 will fix the compatibility with the PHPRedis 6.1.0 release, but the issue persists on the pre-releases (for instance the [6.1.0RC1](https://pecl.php.net/package/redis/6.1.0RC1) version).
I propose to use the new signatures for any 6.1.0 version, including its pre-releases.

```php
version_compare('6.1.0RC1', '6.1.0', '>='); // false
version_compare('6.1.0RC1', '6.1.0-dev', '>='); // true
```

Commits
-------

9569a5f [Cache] Fix compatibility with Redis 6.1.0 pre-releases
@nuryagdym
Copy link
Contributor

after the upgrade to symfony v6.4.12 (which contains this changes) I still had this issue.
running bin/console cache:clear continuing to give this error.

deleting /var/cache folder and then running bin/console cache:clear solved the issue.

@anselmos
Copy link

anselmos commented Nov 27, 2024

This is not working on 6.2 - is there any way to fix it besides upgrading to v6.4.12 ?

@stof
Copy link
Member

stof commented Nov 27, 2024

No. 6.2 is not maintained anymore and so was not patched.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants