phpstorm + xdebug + docker
docker 中phpfpm安装xdebug插件
-
xdebug.remote_host = docker.for.mac.localhost
远程IDE ip, 在mac docker desktop软件中,docker.for.max.localhost 代表宿主机ip -
xdebug.remote_port = 9100
远程IDE监听的端口
phpstorm监听的xdebug端口
phpstorm 配置server,并添加文件映射
这个地址和端口是web访问的地址和端口
同时需要添加文件映射,即本地文件对应docker中的哪个文件
配置debug configure
调试
- 代码中设置断点
- 点击电话按钮进行监听
- 点击爬虫按钮获取调试的id
- 将id 拷贝到postman 使用
防止调试超时
# php.ini
max_execution_time = 7200
# php-fpm.conf
request_terminate_timeout = 0
# nginx.conf
fastcgi_connect_timeout = 7200;
fastcgi_send_timeout = 7200;
fastcgi_read_timeout = 7200;
阅读 1k
0 声望
0 粉丝
0 条评论
得票时间