php - 本地环境中的 Xdebug 错误 [加载 /usr/local/lib/php/pecl/20190902/xdebug.so 失败:]
问题描述
我想在 vscode 上使用 Xdebug。
我在阅读官方文档时尝试了它,但我无法让它工作并得到以下错误。
Failed loading /usr/local/lib/php/pecl/20190902/xdebug.so: dlopen(/usr/local/lib/php/pecl/20190902/xdebug.so, 9): no suitable image found. Did find:
/usr/local/lib/php/pecl/20190902/xdebug.so: stat() failed with errno=20
php --ini
Failed loading /usr/local/lib/php/pecl/20190902/xdebug.so: dlopen(/usr/local/lib/php/pecl/20190902/xdebug.so, 9): no suitable image found. Did find:
/usr/local/lib/php/pecl/20190902/xdebug.so: stat() failed with errno=20
Configuration File (php.ini) Path: /usr/local/etc/php/7.4
Loaded Configuration File: /usr/local/etc/php/7.4/php.ini
Scan for additional .ini files in: /usr/local/etc/php/7.4/conf.d
Additional .ini files parsed: /usr/local/etc/php/7.4/conf.d/ext-opcache.ini
有没有其他人遇到过同样的问题?谢谢你。
解决方案
我通过做类似的事情来完成这项工作:https ://stackoverflow.com/a/48054252
我添加了
export PATH="$(brew --prefix php)/bin:$PATH"
到~/.bash_profile
.
您可以source ~/.bash_profile
在编辑文件后运行以使更改生效。
推荐阅读
- python - Python - XLRDError:不支持的格式,或损坏的文件:预期的 BOF 记录
- node.js - 如何通过请求主机名与 http-proxy-middleware 和 express 设置代理?
- angular - 如何禁用输入字段以防止在角度 4 中进行编辑
- android - firebase实时数据库写入数据错误:firebase中的值不同
- google-cloud-platform - 如何将 Google Cloud Identity 与经典用户名/密码授权集成?
- c++ - OpenGL/C++ 中“2D”相机的移动
- javascript - 字段为空时如何动态更改数组字段的值
- node.js - 无效的架构配置:[OBject Object] 不是数组中的有效类型
- javascript - 是否可以在不重复所述值的情况下从三元运算返回比较值 + 字符串?
- ios - 我如何为滚动视图设置动画?