0

php -v などのコマンドを打つと下記エラーが出ます。
数時間このエラーで躓いていますので、どなたかご回答頂けると幸いです。

エラー内容

dyld: Library not loaded:
/usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib   Referenced from:
/Users/tanakaakio/.phpbrew/php/php-7.1.3/bin/php   Reason: image not
found Abort trap: 6

試したこと

ネット上で検索して、似たようなエラーの記事を見て、PATHを設定し直したりしましたが何も変わらない状況です。

理解したこと

「ライブラリが見つからないよ」というエラーであること

環境/状況
macOS High Sierra

バージョン 10.13.6

$ openssl version
LibreSSL 2.2.7

$ which openssl
/usr/bin/openssl

$ brew --prefix
/usr/local

$ xcode-select --install
xcode-select: error: command line tools are already installed, use
"Software Update" to install updates

$ brew doctor

Please note that these warnings are just used to help the Homebrew
maintainers with debugging if you file an issue. If everything you use
Homebrew for is working fine: please don't worry or file an issue;
just ignore this. Thanks!

Warning: "config" scripts exist outside your system or Homebrew
directories. `./configure` scripts often look for *-config scripts to
determine if software packages are installed, and what additional
flags to use when compiling and linking.

Having additional scripts in your path can confuse software installed
via Homebrew if the config script overrides a system or Homebrew
provided script of the same name. We found the following "config"
scripts:   /Users/tanakaakio/.phpbrew/php/php-7.1.3/bin/php-config

Warning: Broken symlinks were found. Remove them with `brew prune`:  
/usr/local/etc/bash_completion.d/brew-services  
/usr/local/share/zsh/site-functions/_brew_services
tanakfaakionoMacBook-ea:~ tanakaakio$ php -v dyld: Library not loaded:
/usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib   Referenced from:
/Users/tanakaakio/.phpbrew/php/php-7.1.3/bin/php   Reason: image not
found Abort trap: 6

$ brew --version

Homebrew 1.8.4 Homebrew/homebrew-core (git revision 434d; last commit
2018-12-01)
4
  • > Warning: Broken symlinks were found. Remove them with brew prune とのことですので、一旦 brew prune を実行してみてはいかがでしょうか
    – PicoSushi
    2018年12月1日 8:48
  • デッドリンクになっているものを削除ですよね。 2018年12月1日 9:23
  • brew pruneを実行しましたが何も変わりません 2018年12月1日 9:23
  • こちらの記事が参考になるかもしれません。
    – user39889
    2018年12月1日 9:44

1 件の回答 1

0

本家StackOverflowでも同じ質問があるようです。
あちらでは、2つの方法で動作するようになるパターンがある様で

rvm --debug osx-ssl-certs update all

で、ssl関連のファイルをアップデートするか、

brew remove openssl
brew install openssl

で、opensslを1度削除してから再インストールすると動くケースが多い様です。
お試し下さい。

この回答は"phpbrew Library not loaded: /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib"をキーに検索して見つけました

8
  • $ rvm --debug osx-ssl-certs update a -bash: rvm: command not found 2018年12月2日 9:06
  • $ brew remove openssl Uninstalling /usr/local/Cellar/openssl/1.0.2q... (1,794 files, 12.1MB) 2018年12月2日 9:06
  • $ brew install openssl 2018年12月2日 9:06
  • ==> Summary 🍺 /usr/local/Cellar/openssl/1.0.2q: 1,794 files, 12.1MB 2018年12月2日 9:07
  • $ phpbrew dyld: Library not loaded: /usr/local/opt/readline/lib/libreadline.7.dylib Referenced from: /Users/tanakaakio/.phpbrew/php/php-7.1.3/bin/php Reason: image not found Abort trap: 6 2018年12月2日 9:07

この質問に回答するには、ログインする必要があります。

求めていた回答ではありませんか? のタグが付いた他の質問を参照する。