1.输出phpinfo()
phpinfo();
x-debug官方下载地址: https://xdebug.org/download.php
自定义安装说明:https://xdebug.org/wizard.php
【请勿使用翻译成中文!】
1. 下载php_xdebug-2.7.1-7.2-vc15-nts.dll
2. 将下载的文件移动到E:\ phpStudy \ PHPTutorial \ php \ php-7.2.1-nts \ _ex
3. 编辑E:\phpStudy\PHPTutorial\php\php-7.2.1-nts\php.ini并添加该行
4. zend_extension = E:\phpStudy\PHPTutorial\php\php-7.2.1-nts\ext\php_xdebug-2.7.1-7.2-vc15-nts.dll
5. 重新启动Web服务器
2.下载好之后放入php目录的ext文件夹中, 然后设置php.ini, 在最后加上
zend_extension = C:\path\php\ext\php_xdebug-2.4.0rc4-5.6-vc11-x86_64.dll
xdebug.remote_enable =1
xdebug.remote_handler = dbgp
xdebug.remote_host = localhost
xdebug.remote_mode = req
xdebug.remote_port = 9000
xdebug.idekey=PHPSTORM
1. 进入File>Settings>PHP>Servers,这里要填写服务器端的相关信息:
name: localhost,
host: localhost,
port: 80,
debugger: XDebug
如果是自定域名则host设置自定域名, 如laravel5.io
4.进入File>Settings>PHP>Debug,找到XDebug选项卡,port填9000
进入File>Settings>PHP>Debug>DBGp Proxy 填写:
IDE key: phpStorm
host: localhost
port: 80
5.设置完毕,点OK退出。
6.点菜单栏的Run>Edit Configurations… 在弹出的窗口中添加一个调试配置:
点击左上角加号,选择PHP Web Page
success:!