PHP
Mac
homebrew

MacでPHP実行時にLibrary読み込みエラーが出る

環境情報

  • macOS Mojave 10.14

問題

macターミナルでphpを動かそうとすると下記エラーが出る

$ php -v
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.61.dylib
  Referenced from: /usr/local/opt/php@7.2/bin/php
  Reason: image not found
Abort trap: 6

解決方法:boar:

$ brew reinstall php@7.2

$ php -v
PHP 7.2.13 (cli) (built: Dec  7 2018 10:41:23) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.13, Copyright (c) 1999-2018, by Zend Technologies