无法打开 PHP,dyld:未加载库
Can't open PHP, dyld: Library not loaded
我知道还有许多其他问题与此错误相关,但我已经尝试了所有答案,但没有任何效果。
完全错误
dyld: Library not loaded: /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib
Referenced from: /usr/local/opt/php@7.1/bin/php
Reason: image not found
Abort trap: 6
错误是什么时候发生的?
在通过 RVM 将 Ruby 更新到 2.6.3 之后。
每当我在终端中输入 "php" 时,就会出现错误。
已走步数
- 基本步骤:重启Macbook,打开新终端window。
- Uninstall/Reinstall: 节点, Openssl, libpng, Ruby
- Update/Upgrade: 酿造
- Unlinked/Linked: libidn, autoconf
- 通过 chown -R 赋予我自己所有权利 /usr/local
- OpenSSL: $ sudo rm /usr/bin/openssl, brew reinstall openssl@1.1
- 酿造清理
- 已重新安装PHP
版本
Mac OS 莫哈韦沙漠 10.14.6
PHP 7.4
- Ruby 2.6.3p62
- RVM 1.29.9
当运行 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 which 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:
/opt/local/bin/python2.7-config
/opt/local/bin/curl-config
/opt/local/bin/ncursesw6-config
/opt/local/bin/pcre-config
/opt/local/bin/ncurses6-config
/opt/local/bin/pcap-config
Warning: Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected header files:
(here it posts all the /usr/local/include/node files, but the list exceeds character limitations)
关于如何解决此错误的任何想法?
我会为可能 运行 遇到类似问题的其他人回答我自己的问题
卸载并重新安装每一个 brew 桶后,我找到了以下解决方案:
- 卸载PHP
- 运行 酿造清理
- 检查您的 /usr/local/opt 文件夹中是否有任何名为 php
的文件夹
- 删除文件夹(在我的例子中它被称为 'php@7.1')
- 打开一个新终端window
- 运行 'brew search php' 并确保没有安装 php keg。
- 只需在终端中输入'php -v'。对我来说,这显示了一个版本号,表明 php 是(在某一时刻)在没有 brew 的情况下安装的。您可以选择卸载此版本或更新至最新版本。
结论
就我而言,我认为只是 PHP 7.1 已经安装,我通过 brew 安装了第二个版本 (7.4)。
错误'Referenced from: /usr/local/opt/php@7.1/bin/php'明明是在这个文件夹里找东西,删了之后,错误就停止了。
我有类似的问题,我是这样解决的:
brew reinstall php
我知道还有许多其他问题与此错误相关,但我已经尝试了所有答案,但没有任何效果。
完全错误
dyld: Library not loaded: /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib
Referenced from: /usr/local/opt/php@7.1/bin/php
Reason: image not found
Abort trap: 6
错误是什么时候发生的?
在通过 RVM 将 Ruby 更新到 2.6.3 之后。
每当我在终端中输入 "php" 时,就会出现错误。
已走步数
- 基本步骤:重启Macbook,打开新终端window。
- Uninstall/Reinstall: 节点, Openssl, libpng, Ruby
- Update/Upgrade: 酿造
- Unlinked/Linked: libidn, autoconf
- 通过 chown -R 赋予我自己所有权利 /usr/local
- OpenSSL: $ sudo rm /usr/bin/openssl, brew reinstall openssl@1.1
- 酿造清理
- 已重新安装PHP
版本
Mac OS 莫哈韦沙漠 10.14.6
PHP 7.4
- Ruby 2.6.3p62
- RVM 1.29.9
当运行 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 which 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:
/opt/local/bin/python2.7-config
/opt/local/bin/curl-config
/opt/local/bin/ncursesw6-config
/opt/local/bin/pcre-config
/opt/local/bin/ncurses6-config
/opt/local/bin/pcap-config
Warning: Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected header files:
(here it posts all the /usr/local/include/node files, but the list exceeds character limitations)
关于如何解决此错误的任何想法?
我会为可能 运行 遇到类似问题的其他人回答我自己的问题
卸载并重新安装每一个 brew 桶后,我找到了以下解决方案:
- 卸载PHP
- 运行 酿造清理
- 检查您的 /usr/local/opt 文件夹中是否有任何名为 php 的文件夹
- 删除文件夹(在我的例子中它被称为 'php@7.1')
- 打开一个新终端window
- 运行 'brew search php' 并确保没有安装 php keg。
- 只需在终端中输入'php -v'。对我来说,这显示了一个版本号,表明 php 是(在某一时刻)在没有 brew 的情况下安装的。您可以选择卸载此版本或更新至最新版本。
结论
就我而言,我认为只是 PHP 7.1 已经安装,我通过 brew 安装了第二个版本 (7.4)。
错误'Referenced from: /usr/local/opt/php@7.1/bin/php'明明是在这个文件夹里找东西,删了之后,错误就停止了。
我有类似的问题,我是这样解决的:
brew reinstall php