shivammathur/homebrew-php

receive "PHP Warnings" since last upgrade

OskarStark opened this issue · 2 comments

Describe the bug

PHP Warning:  Module "igbinary" is already loaded in Unknown on line 0
PHP Warning:  Module "imap" is already loaded in Unknown on line 0
PHP Warning:  Module "msgpack" is already loaded in Unknown on line 0

PHP versions
At least with 8.1, didn't check the lower versions

To Reproduce
run this file:

#!/bin/bash

# This is based on:
# * https://github.com/shivammathur/homebrew-php
# * https://github.com/shivammathur/homebrew-extensions

PHP_VERSIONS="5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1" # last one is used as default PHP version
EXTENSIONS="amqp imagick imap pcov redis"

echo "Add taps (--force-auto-update)"
HOMEBREW_DEVELOPER=1 brew untap shivammathur/php
brew tap shivammathur/php --force-auto-update
HOMEBREW_DEVELOPER=1 brew untap shivammathur/extensions
brew tap shivammathur/extensions --force-auto-update

echo "Remove all available PHP configs"
rm -rf /usr/local/etc/php/*

echo "Uninstall imap-uw"
brew uninstall --ignore-dependencies imap-uw

for version in $PHP_VERSIONS
do
    echo "Install PHP $version with: $EXTENSIONS"

    brew reinstall shivammathur/php/php@$version
    brew link --overwrite --force php@$version

    for extension in $EXTENSIONS
    do
        if [ "$extension" = "pcov" ] && { [ "$version" = "5.6" ] || [ "$version" = "7.0" ]; }; then break; fi

        echo "Extension: $extension"

        if [ "$extension" = "redis" ]; then
            brew remove redis@$version || true
            brew remove igbinary@$version || true
            brew remove msgpack@$version || true
        fi

        brew reinstall shivammathur/extensions/$extension@$version
    done

    php -v
    for extension in $EXTENSIONS
    do
        php -m | grep $extension
    done
done
``

**Expected behavior**
No warnings

**Screenshots/Logs**
<img width="699" alt="CleanShot 2022-07-12 at 19 55 24@2x" src="https://user-images.githubusercontent.com/995707/178560543-5107e89d-1c14-4177-af47-945521bcfb5a.png">

**Additional context**
-

**Are you willing to submit a PR?**
-

Sorry for the breaking change.
Please run php --ini.
If you have both igbinary.ini and 20-igbinary.ini, delete the igbinary.ini. Same for msgpack and imap.

Thanks, that fixes my problem!