当前位置: 首页 > news >正文

m1 + swoole(hyperf) + yasd + phpstorm 安装和debug

参考文档 Mac M1安装报错 checking for boost... configure: error: lib boost not found. Try: install boost library · Issue #89 · swoole/yasd · GitHub

1.安装boost库

brew install boostbrew link boost

2.下载yasd

git clone https://github.com/swoole/yasd.git

3.编译安装

phpize --clean && \phpize && \./configure && \make clean && \make && \make install

安装遇到问题 

说明你的环境变量中没有引用到boost的库 需要按照你的路径添加环境变量

并且加到相应env下 加env

报错 ld: library not found for -lboost_filesystem

export CPLUS_INCLUDE_PATH=/opt/homebrew/Cellar/boost/1.78.0_1/includeexport LD_LIBRARY_PATH=/opt/homebrew/Cellar/boost/1.78.0_1/libexport LIBRARY_PATH="$LIBRARY_PATH:/opt/homebrew/Cellar/boost/1.78.0_1/lib"

软连接

报错 checking for boost... configure: error: lib boost not found.  Try: install boost library
 

ln -s /opt/homebrew/Cellar/boost/1.78.0_1/lib/libboost_filesystem.dylib /usr/local/libln -s /opt/homebrew/Cellar/boost/1.78.0_1/include/boost /usr/local/include/boost

继续设置 php.ini 文件:

我的目录在 /opt/homebrew/etc/php/7.4/php.ini

zend_extension=yasdyasd.debug_mode=remoteyasd.remote_host=127.0.0.1yasd.remote_port=9000

查看拓展是否安装正确 php --ri yasd 输出以下信息位正确

yasdYasd => enabled
Author => codinghuang <codinghuang@qq.com>
Version => 0.3.9-alpha
Built => Jan 10 2024 13:41:49Directive => Local Value => Master Value
yasd.breakpoints_file => no value => no value
yasd.debug_mode => remote => remote
yasd.remote_host => 127.0.0.1 => 127.0.0.1
yasd.remote_port => 9000 => 9000
yasd.depth => 1 => 1
yasd.log_level => -1 => -1
yasd.max_executed_opline_num => 0 => 0
yasd.init_file => no value => no value
yasd.open_extended_info => 0 => 0
xdebug.coverage_enable => 1 => 1
xdebug.profiler_enable => 1 => 1
xdebug.remote_autostart => 1 => 1
xdebug.remote_connect_back => 0 => 0
xdebug.remote_mode => req => req
xdebug.idekey => hantaohuang => hantaohuang

最后运行的时候 看看9000端口是不是被占用了。我调试了半天 提示 

[yasd] recv command error, connection closedlsof -i:9000

如果被占用更换一个端口就可以

php --ini |grep "ini"   

可以查看php配置文件路径。切记不要xdebug 和yasd同时打开。会起不来

Configuration File (php.ini) Path: /opt/homebrew/etc/php/7.4
Loaded Configuration File:         /opt/homebrew/etc/php/7.4/php.ini
Scan for additional .ini files in: /opt/homebrew/etc/php/7.4/conf.d
Additional .ini files parsed:      /opt/homebrew/etc/php/7.4/conf.d/99-xdebug.ini,

phpstorm 

只需要配置调试端口就可以

启动的时候要带-e参数

参考文档

Hyperf+PhpStorm+Yasd 实现Hyperf项目的debug调试与[yasd] recv command error, connection closed问题解决_[yasd] connect ide failed (connection refused), pl-CSDN博客

http://www.lryc.cn/news/279824.html

相关文章:

  • group by 查询慢的话,如何优化?
  • 【重学C语言】一、C语言简介
  • 【MATLAB源码-第109期】基于matlab的哈里斯鹰优化算发(HHO)机器人栅格路径规划,输出做短路径图和适应度曲线。
  • NestJS 如何自定义中间件以及实际项目基于中间件提升项目开发效率
  • CMake入门教程【核心篇】设置和使用缓存变量
  • MinIO (五) .net core实现分片上传
  • 如何有效提高矢量网络分析仪的动态范围
  • Python 安卓开发:Kivy、BeeWare、Flet、Flutter
  • 50天精通Golang(第16天)
  • imx6ull基于yocto工程的l汇编点亮ed
  • vue 前端等比例压缩图片(再转换成文件后上传后端)
  • 解决在eclipse2021中,用mysql-connector-java-8.0.18.jar不兼容,导致无法访问数据库问题
  • 5 微信小程序
  • 百度面经整理(2024最新)
  • c++的构造函数
  • 基于ZU19EG的100G-UDP解决方案
  • 行为型设计模式——备忘录模式
  • 自定义HBase负载均衡器MyCustomBalancer实现步骤与代码解析
  • 企业网站建设中常用的英文翻译
  • vscode运行Python的两种方法,及无法运行的原因
  • 【猫头虎分享】全面揭秘鸿蒙4.0:华为的技术革新与市场影响
  • Java内存模型之可见性
  • 【docker】Docker Compose 使用介绍
  • uniapp怎么开发插件并发布
  • 为什么不直接public,多此一举用get、set,一文给你说明白
  • golang 记录一次协程和协程池的使用,利用ants协程池来处理定时器导致服务全部阻塞
  • 【Postman-windows-9.12.2版本安装与汉化】
  • 11Spring IoC注解式开发(下)(负责注入的注解/全注解开发)
  • Grafana Promtail 配置解析
  • 电脑DIY-主板参数