debian

Debian下phpstorm与Xdebug如何配合

小樊
40
2025-09-09 13:48:39
栏目: 编程语言

在Debian下让PhpStorm与Xdebug配合,可按以下步骤操作:

  1. 安装Xdebug:在终端中运行sudo apt-get updatesudo apt-get install php-xdebug
  2. 配置php.ini文件:找到对应的php.ini文件,添加zend_extension=xdebug.soxdebug.mode=debugxdebug.client_host=127.0.0.1xdebug.client_port=9003xdebug.idekey=PHPSTORM等配置,然后重启Web服务器。
  3. 配置PhpStorm:打开PhpStorm,依次进入“File”>“Settings”>“Languages & Frameworks”>“PHP”>“Debug”,确保启用Xdebug,设置“IDE Key”为“PHPSTORM”,“Host”为“localhost”,“Port”为9003,还可设置其他参数。
  4. 设置断点:在PhpStorm的PHP文件中,单击行号旁边的空白处设置断点。
  5. 启动调试:在PhpStorm中点击“Start Listening for PHP Debug Connections”按钮(电话图标)或按Shift+F9,然后在浏览器中访问应用程序,若配置正确,代码会在断点处暂停,可进行调试操作。

0
看了该问题的人还看了