Closed jrchamp closed 1 month ago
Hi,
same thing is happening over in our repo. Started today. https://github.com/RSS-Bridge/rss-bridge/issues/4299
I ran a test with some extra steps:
- name: Check for redis files before setup-php
if: ${{ !cancelled() }}
run: find /etc/php -name \*redis\*
- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ matrix.extensions }}
ini-values: max_input_vars=5000
coverage: none
- name: Check for redis files after setup-php
if: ${{ !cancelled() }}
run: find /etc/php -name \*redis\*
Output:
Run find /etc/php -name \*redis\*
/etc/php/8.1/phpdbg/conf.d/20-redis.ini
/etc/php/8.1/cgi/conf.d/20-redis.ini
/etc/php/8.1/mods-available/redis.ini
/etc/php/8.1/cli/conf.d/20-redis.ini
/etc/php/8.1/fpm/conf.d/20-redis.ini
Run find /etc/php -name \*redis\*
/etc/php/8.1/phpdbg/conf.d/20-redis.ini
/etc/php/8.1/phpdbg/conf.d/25-redis.ini
/etc/php/8.1/cgi/conf.d/20-redis.ini
/etc/php/8.1/cgi/conf.d/25-redis.ini
/etc/php/8.1/mods-available/redis.ini
/etc/php/8.1/embed/conf.d/25-redis.ini
/etc/php/8.1/cli/conf.d/20-redis.ini
/etc/php/8.1/cli/conf.d/25-redis.ini
/etc/php/8.1/fpm/conf.d/20-redis.ini
/etc/php/8.1/fpm/conf.d/25-redis.ini
So it looks like setup-php is adding extra redis.ini files with a "run order" of 25 which duplicates the pre-existing run order of 20 which is pre-installed on the GitHub Hosted runner images.
Looking into this
@oerdnj released a new version of the php-redis package last week. One of the changes is "Change priority of redis extension loading to 25"
For anyone facing this.
For ubuntu-22.04
and ubuntu-24.04
, this has been fixed in https://github.com/shivammathur/php-ubuntu/commit/edd8d435d02e4351f946b5502d4759ba9c2eae2a and no action is required.
For ubuntu-20.04
, please set the env update: true
in your workflow and that should fix it.
The fix for ubuntu-20.04 worked! Thanks a lot!
Describe the bug Getting PHP warning during the setup-php action and subsequent PHP processes:
PHP Warning: Module "redis" is already loaded in Unknown on line 0
This breaks the moodlehq/moodle-plugin-ci because PHP warnings are not allowed during CI tests.
Version
v1
orv2
.v2
v1
Runners
Operating systems
ubuntu-latest (ubuntu-22.04)
PHP versions
This is only a problem on PHP 8.1. PHP 7.2, 7.4, 8.0, 8.2 and 8.3 all succeed.
To Reproduce
Expected behavior
No PHP warnings.
Screenshots/Logs
Runner:
Additional context
Are you willing to submit a PR?
I don't know how to fix the problem, but I'd be happy to submit a PR if that would help.