$ php -v dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.63.dylib Referenced from: /usr/local/opt/php@7.2/bin/php Reason: image not found [1] 31174 abort php -v
온라인 검색을 통해 php 동적 라이브러리 7.2의 새 버전이 나왔다는 것을 알게 되었습니다. .16은 버전 63을 사용할 수 없으므로 PHP를 업그레이드하면 문제를 해결할 수 있습니다. [추천 학습: PHP 비디오 튜토리얼]
brew를 사용하여 php를 업그레이드
$ brew upgrade php72 ==> Upgrading 1 outdated package: php@7.2 7.2.16 -> 7.2.20 ==> Upgrading php@7.2 ==> Installing dependencies for php@7.2: apr, argon2, libssh2, jemalloc, libev, nghttp2, curl-openssl, freetds, libpq and libsodium ==> Installing php@7.2 dependency: apr ==> Downloading https://homebrew.bintray.com/bottles/apr-1.7.0.mojave.bottle.tar.gz ==> Downloading from https://akamai.bintray.com/3a/3a245185ed7280d1a19e7c639786b4c21dd0088878be8ac87ca58510eb5c9cc1?__gda__=exp=1563530722~hmac=8e94698ea6aa458b7dfea49d1cde602217ab9a2 ######################################################################## 100.0% ==> Pouring apr-1.7.0.mojave.bottle.tar.gz ==> Caveats apr is keg-only, which means it was not symlinked into /usr/local, because Apple's CLT package contains apr. If you need to have apr first in your PATH run: echo 'export PATH="/usr/local/opt/apr/bin:$PATH"' >> ~/.zshrc
모든 것이 완료된 후 php를 실행하여 버전을 확인하세요:
$ php -v PHP 7.2.20 (cli) (built: Jul 5 2019 12:51:26) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.2.20, Copyright (c) 1999-2018, by Zend Technologies