PHPStorm+XDebug进行调试,phpstormxdebug_PHP教程

WBOY
Release: 2016-07-12 08:50:25
Original
975 people have browsed it

PHPStorm+XDebug进行调试,phpstormxdebug

笔者的开发环境如下: Windows8.1+Apache+PhpStorm+XDebug+Firefox(XDebug helper 1.4.3插件)。

一、XDebug安装配置

(1)下载XDebug 下载地址:http://www.xdebug.org/ 必须下载跟机器上安装的php匹配的版本才行。具体下载方法如下: 将phpinfo网页的源代码拷贝到http://www.xdebug.org/find-binary.php,然后按照指导安装即可。如下图所示: PHPStorm+XDebug进行调试 - 王丽兵 - 老王

 PHPStorm+XDebug进行调试 - 王丽兵 - 老王

(2)安装XDebug 按照上图下载“php_xdebug-2.3.2-5.4-vc9.dll”,将其复制到d:\php\ext\目录。 (3)配置XDebug 打开d:\php\php.ini,在末尾增加如下代码:

[Xdebug]
zend_extension = d:\php\ext\php_xdebug-2.3.2-5.4-vc9.dll
xdebug.remote_enable =1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "localhost"
xdebug.remote_mode = "req"
xdebug.remote_port = 9000

    重启Apache。 (4)验证安装是否成功 检测方法1: 在phpinfo网页中,能够检索到XDebug字样,就安装成功了,如下图所示: PHPStorm+XDebug进行调试 - 王丽兵 - 老王

  检测方法2:

在cmd下输入php -m,能看到XDebug说明配置成功。如下图所示: PHPStorm+XDebug进行调试 - 王丽兵 - 老王 二、PHPStorm中XDebug配置 在【File】->【Settings】->【Languages & Frameworks】->【PHP】的Setting中: (1)配置PHP Server 找到【Servers】,配置项如下: Name:localhost Host:localhost Port:80 Debugger:XDebug 如下图所示: PHPStorm+XDebug进行调试 - 王丽兵 - 老王   (2)配置PHP Debug 找到【Debug】,XDebug中的Debug Port填写9000,其它默认。如下图所示: PHPStorm+XDebug进行调试 - 王丽兵 - 老王 三、Fireforx中XDebog helper插件的配置 (1)安装XDebug helper插件 如下图所示: PHPStorm+XDebug进行调试 - 王丽兵 - 老王

 

(2)配置XDebug helper插件 在上图中,点击【选项】,然后按照如下进行配置: IDE key:PhpStorm Domain filter:localhost 如下图所示: PHPStorm+XDebug进行调试 - 王丽兵 - 老王 四、使用XDebug调试方法及步骤 (1)在PHPStorm中开启Debug监听 点击那个像电话一样的图标即可开启Debug监听,如下图所示: PHPStorm+XDebug进行调试 - 王丽兵 - 老王 (2)在Chrome浏览器中开启XDebug helper插件 方法一: 在地址栏中,点击那个的虫子,选择Debug,如下图所示: PHPStorm+XDebug进行调试 - 王丽兵 - 老王 方法二: 使用快捷键:CTRL+SHIFT+X进行配置。 (3)在PHPStorm中设置断点 在行号后面空白处单击即可设置断点。 (4)断点调试 然后在浏览器中引导到相应的断点处的方法即可自动被断下来,如下图所示: PHPStorm+XDebug进行调试 - 王丽兵 - 老王

  红色框框中有所有的断点处理方式及快捷键提示。

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/1133412.htmlTechArticlePHPStorm+XDebug进行调试,phpstormxdebug 笔者的开发环境如下:Windows8.1+Apache+PhpStorm+XDebug+Firefox(XDebug helper 1.4.3插件)。 一、XDebug安装配置 (1)...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!