mac上使用php时报错dyld: Library not loaded: /usr/local/opt/tidy-html5/lib/libtidy.5.dylib, 怎么解决dyld: Libra

>之前php是通过brew安装的,一直用得很好,最近brew update以下,再使用发现报了这个错,dyld: Library not loaded: /usr/local/opt/tidy-html5/lib/libtidy.5.dylib.一通找,发现如下方案都不得行.
网上有说重装tidy: `brew reinstall tidy-html5`, 重装tidy后还是一样的报错
另一个方案是软连接, 其实在/usr/local/opt/tidy-html5/lib/下是有个libtidy.5.8.dylib,不过名称和libtidy.5.dylib不一样,所以其实只要软链接一个即可,`ln -s /usr/local/opt/tidy-html5/lib/libtidy.5.8.dylib /usr/local/opt/tidy-html5/lib/libtidy.5.dylib`.这样tidy问题解决了.但以我的经验,要有其他的lib也出现同样的错误,我如法炮制软链接几个后发现还有lib没被load.果断放弃.

最后,青春宝贵,最佳实践是重装php即可快速解决(你的php版本可能和我不同,在使用如下请自行变通).上代码:
- 卸载当前php
`brew uninstall [email protected]`
- 安装php
  `brew install [email protected]`
   - 如果你安装php版本太旧,会报错(7.2就会)[email protected] has been disabled because it is deprecated upstream! 
 看我这篇博文3个命令搞定 [(mac上使用brew安装旧版php,执行brew install [email protected]报错Error: [email protected] has been disabled because it is deprecated upstream!)](https://blog.nice100.net/php/131.html)

(from my blog: https://blog.nice100.net/php/132.html)

你可能感兴趣的:(php,php)