怎么在phpstorm中配置xdebug-创新互联

怎么在phpstorm中配置xdebug?很多新手对此不是很清楚,为了帮助大家解决这个难题,下面小编将为大家详细讲解,有这方面需求的人可以来学习下,希望你能有所收获。

创新互联建站网站建设公司,提供成都网站设计、成都做网站、外贸网站建设,网页设计,建网站,PHP网站建设等专业做网站服务;可快速的进行网站开发网页制作和功能扩展;专业做搜索引擎喜爱的网站,是专业的做网站团队,希望更多企业前来合作!

php有什么用

php是一个嵌套的缩写名称,是英文超级文本预处理语言,它的语法混合了C、Java、Perl以及php自创新的语法,主要用来做网站开发,许多小型网站都用php开发,因为php是开源的,从而使得php经久不衰。

编译源码


phpize
./configure --with-php-config=/usr/local/Cellar/php@7.2/7.2.16/bin/php-config
make && make install 

Installing shared extensions: /usr/local/Cellar/php@7.2/7.2.16/pecl/20170718/

编译到了这个目录,实际软连到了/usr/local/lib/php/pecl

配置xdebug

在/usr/local/etc/php/7.2/conf.d 新建ext-xdebug.ini 写入

[xdebug]
zend_extension="/usr/local/lib/php/pecl/20170718/xdebug.so"
xdebug.remote_enable=On
xdebug.remote_connect_back=1
xdebug.remote_port=6677
xdebug.remote_log=/usr/local/var/log/xdebug.log
xdebug.idekey=PHPSTORM
  • xdebug.idekey = mykey ide key, 用于标识调试会话

  • xdebug.remote_autostart 是否自动启动,1:自动, 0: 需要设置 http 请求参数或 cookie 指定,默认 0, 根据需求设置这个值。个人建议设置为 1, 这样不需要在每个需要调试的接口都修改请求参数

  • xdebug.remote_enable = on 是否开启远程调试

  • xdebug.remote_host = 172.16.10.103 远程主机 IP, 也就是 PHPStorm 所在机器(PHPStorm 作为 xdebug client),没有固定 IP 的机器建议使用 connect_back 选项。

  • xdebug.remote_connect_back = on 是否连接回请求发出的主机,如果 PHPStorm 所在的机器 IP 经常变动(DHCP 环境下),则建议开启这个选项

  • xdebug.remote_port = 10000 远程主机端口,也就是开发者机器端口

  • xdebug.idekey=PHPSTROM 和phpstorm 通信的标识

重启php,查看是否安装成功

/usr/local/etc/php/7.2/conf.d php -m | grep xdebug

搞定!!

开始配置phpstorm


设置端口


怎么在phpstorm中配置xdebug

设置servers

怎么在phpstorm中配置xdebug

配置debug config

怎么在phpstorm中配置xdebug

访问url?XDEBUG_SESSION_START=PHPSTORM,搞定

怎么在phpstorm中配置xdebug

看完上述内容是否对您有帮助呢?如果还想对相关知识有进一步的了解或阅读更多相关文章,请关注创新互联行业资讯频道,感谢您对创新互联网站建设公司,的支持。


分享题目:怎么在phpstorm中配置xdebug-创新互联
标题URL:http://myzitong.com/article/djossg.html