PhpStrom + Xdebug 配置宝塔面板 PHP 断点调试
PhpStrom 2021.1.4
PHP 7.2
Xdebug 2.7.2
宝塔 7.2.0
文章目录
主要路径
- 参考教程:主要按教程中进行设置,本文主要对其中与宝塔相关部分进行补充
- php ROOT:宝塔根目录下(
D:\BtSoft\php\
) - php 配置信息:
[php ROOT]\\[版本号]\\php.ini
- Xdebug 官网
- Xdebug 版本自动选择
主要步骤
下载并配置 Xdebug
使用宝塔自带 Xdebug
-
宝塔自带
xdebug.dll
文件,但在php.ini
中被注释了,解除注释即可使用。 -
在
php.ini
中修改 Xdebug 相关配置,以下给出示例[XDebug] zend_extension=php_xdebug.dll xdebug.remote_port = 9123 xdebug.remote_host = "127.0.0.1" xdebug.profiler_output_dir ="D:\BtSoft\temp\xdebug" xdebug.trace_output_dir ="D:\BtSoft\temp\xdebug" xdebug.profiler_append = 0 xdebug.profiler_enable = 1 xdebug.profiler_enable_trigger = 0 xdebug.idekey="PHPSTORM" xdebug.profiler_output_name = "cache.out.%t-%s" xdebug.remote_enable = 1 xdebug.remote_handler = "dbgp"
- 使用时注意更改前五行的路径、端口、文件名等信息
- 参考教程中端口为
9001
,但由于本机9001
端口被占用,故设为9123
使用更新的 Xdebug
- 在官网下载后将文件放置于
[php ROOT]\\ext
- 在
php.ini
中修改配置,具体同宝塔自带 Xdebug 的情况,注意文件名。
配置 PhpStorm
CLI 解释器
File