phpenv で PHP7.3.24 がインストールできない virtual function 'operator==' has a different return type

前提

MacM1 を使って、phpenv で PHP7.3 台をインストールしようとすると、下のようなエラーが出てくる。ネットで調べても、Valet-PHP(?) の エラーしか出てこない。

bash

----------------- | BUILD ERROR |----------------- Here are the last 10 lines from the log: ----------------------------------------- make: *** [ext/intl/breakiterator/codepointiterator_internal.lo] Error 1In file included from /var/tmp/php-build/source/7.3.24/ext/intl/breakiterator/codepointiterator_methods.cpp:17: /var/tmp/php-build/source/7.3.24/ext/intl/breakiterator/codepointiterator_internal.h:42:17: error: virtual function 'operator==' has a different return type ('UBool' (aka 'signed char')) than the function it overrides (which has return type 'bool') virtual UBool operator==(const BreakIterator& that) const; ~~~~~ ^ /opt/homebrew/Cellar/icu4c/71.1/include/unicode/brkiter.h:127:18: note: overridden virtual function is here virtual bool operator==(const BreakIterator&) const = 0; ~~~~ ^ 1 error generated. make: *** [ext/intl/breakiterator/codepointiterator_methods.lo] Error 1-----------------------------------------

イメージ説明

実現したいこと

  • phpenv で PHP7.3 台をインストールできるようにする。下記のソースコードのコマンドを入力しました。

発生している問題・エラーメッセージ

bash

----------------- | BUILD ERROR |----------------- Here are the last 10 lines from the log: ----------------------------------------- make: *** [ext/intl/breakiterator/codepointiterator_internal.lo] Error 1In file included from /var/tmp/php-build/source/7.3.24/ext/intl/breakiterator/codepointiterator_methods.cpp:17: /var/tmp/php-build/source/7.3.24/ext/intl/breakiterator/codepointiterator_internal.h:42:17: error: virtual function 'operator==' has a different return type ('UBool' (aka 'signed char')) than the function it overrides (which has return type 'bool') virtual UBool operator==(const BreakIterator& that) const; ~~~~~ ^ /opt/homebrew/Cellar/icu4c/71.1/include/unicode/brkiter.h:127:18: note: overridden virtual function is here virtual bool operator==(const BreakIterator&) const = 0; ~~~~ ^ 1 error generated. make: *** [ext/intl/breakiterator/codepointiterator_methods.lo] Error 1-----------------------------------------

該当のソースコード

bash

PHP_RPATHS="$(brew --prefix bzip2)" PHP_BUILD_CONFIGURE_OPTS="--with-bz2=$(brew --prefix bzip2) --with-iconv=$(brew --prefix libiconv) --with-libedit=/usr/local/opt/libedit --with-tidy=$(brew --prefix tidy-html5) --with-zlib=$(brew --prefix zlib) --with-jpeg-dir=$(brew --prefix libjpeg) --with-png-dir=$(brew --prefix libpng) --with-libedit=$(brew --prefix libedit) --with-openssl=$(brew --prefix openssl@1.1)" \PKG_CONFIG_PATH="/usr/local/opt/krb5/lib/pkgconfig:/usr/local/opt/icu4c/lib/pkgconfig:/usr/local/opt/libedit/lib/pkgconfig:/usr/local/opt/libjpeg/lib/pkgconfig:/usr/local/opt/libpng/lib/pkgconfig:/usr/local/opt/libxml2/lib/pkgconfig:/usr/local/opt/libzip/lib/pkgconfig:/usr/local/opt/oniguruma/lib/pkgconfig:/usr/local/opt/openssl@1.1/lib/pkgconfig:/usr/local/opt/tidy-html5/lib/pkgconfig:/opt/homebrew/opt/jpeg/include" \phpenv install 7.3.24

export CPPFLAGS="-DU_DEFINE_FALSE_AND_TRUE=1" export LDFLAGS="-L/opt/homebrew/opt/bzip2/lib:/opt/homebrew/opt/openssl@1.1/lib"

https://zenn.dev/39ff/articles/efe3ef8a8f1061

などを参考にしました。

試したこと

https://zenn.dev/39ff/articles/efe3ef8a8f1061

https://qiita.com/YmBIgo/questions/bcff3b17258da51b70c0

を参考にしました。8.1.10 はダウンロードできました。

もしお時間があったら、よろしくお願いします。

コメントを投稿

0 コメント