简体   繁体   中英

php -v command gives “dyld: Library not loaded” error

php not working in my pc. apache server is working.

when check php version on terminal it gives below error.

dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.63.dylib
  Referenced from: /usr/local/bin/php
  Reason: image not found
Abort trap: 6
  • Completely uninstall the homebrew/php install
    $ brew uninstall --force php@7.1
  • Un-tap homebrew-php since we will not be needing it any longer
    $ brew untap homebrew/php
  • Next, I ran some brew commands to cleanup dead symlinks and older installs. This is a Brew wide operations, so completely optional if you don't want to do this part.
    $ brew prune && brew cleanup
  • Update Homebrew and formulae
    $ brew update
  • Install the homebredw-core version of PHP 7.1
    $ brew install php71

reference ( https://mark.shropshires.net/blog/how-reinstall-homebrew-php-after-move-homebrewphp-homebrewcore )

now the result for the command php -version

PHP 7.1.19 (cli) (built: Aug 17 2018 20:10:18) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM