参考:

下载合适的XDebug

点击这里,选择合适xdebug

XAMPP配置

php_xdebug-xxxx.dll

拷贝dll至 D:\XAMPP\php\ext

php.ini

文末追加

[XDebug]
zend_extension = "D:\XAMPP\php\ext\php_xdebug-2.7.0RC2-7.3-vc15.dll"
xdebug.profiler_append =
xdebug.profiler_enable =
xdebug.profiler_enable_trigger =
xdebug.profiler_output_dir = "d:\xampp\tmp"
;xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_enable =
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "127.0.0.1"
xdebug.remote_log="d:\xampp\tmp\xdebug.txt"
xdebug.remote_port =
xdebug.trace_output_dir = "d:\xampp\tmp"
; ( hour), = 10h
xdebug.remote_cookie_expire_time =
xdebug.idekey="PhpStorm"

Stop/Start Apache

检查xdebug是否安装成功

方法1:运行 http://localhost/dashboard/phpinfo.php 并检查xdebug

方法2:php -m 并检查xdebug

PHPStorm配置

xdebug相应配置

  • 打开phpStorm,进入File>Settings>PHP>Servers,这里要填写服务器端的相关信息,name填localhost,host填localhost,port填80,debugger选XDebug
  • 进入File>Settings>PHP>Debug,看到XDebug选项卡,port填9000,其他默认
  • 进入File>Settings>PHP>Debug>DBGp Proxy,IDE key 填 PHPSTORM,host 填localhost,port 填80
  • 点OK退出设置

PHPstorm项目配置

指定PHP intepreter

指定项目部署位置

浏览器配置

在适当浏览器上安装插件,这里

以Chrome为例,安装完插件后如图

测试xdebug

实验代码

orderform.html

<html>
<head><title>Bob's Auto Parts</title></head>
<body>
<form action="processorder.php" method="post">
<table border="0">
<tr bgcolor="#cccccc">
<td width="150">Item</td>
<td width="15">Quantity</td>
</tr>
<tr>
<td>Tires</td>
<td align="center"><input type="text" name="tireqty" size="3"
maxlength="3" /></td>
</tr>
<tr>
<td>Oil</td>
<td align="center"><input type="text" name="oilqty" size="3"
maxlength="3" /></td>
</tr>
<tr>
<td>Spark Plugs</td>
<td align="center"><input type="text" name="sparkqty" size="3"
maxlength="3" /></td>
</tr>
<tr>
<td>How did you find Bob's?</td>
<td><select name="find">
<option value = "a">I'm a regular customer</option>
<option value = "b">TV advertising</option>
<option value = "c">Phone directory</option>
<option value = "d">Word of mouth</option>
</select>
</td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" value="Submit Order" /></td>
</tr>
</table>
</form>
</body>
</html>

processorder.php

<html>
<head>
<title>Bob's Auto Parts - Order Results</title>
</head>
<body>
<h1>Bob's Auto Parts</h1>
<h2>Order Results</h2>
<?php
echo '<p>Order processed at ';
echo date('H:i, jS F');
echo '</p>';
echo '<p>Your order is as follows: </p>';
echo $tireqty.' tires<br />';
echo $oilqty.' bottles of oil<br />';
echo $sparkqty.' spark plugs<br />'; $totalqty = 0;
$totalamount = 0.00; $totalqty = 0;
$totalqty = $tireqty + $oilqty + $sparkqty;
echo 'Items ordered: '.$totalqty.'<br />'; $totalamount = 0.00; define('TIREPRICE', 100);
define('OILPRICE', 10);
define('SPARKPRICE', 4); $totalamount = $tireqty * TIREPRICE
+ $oilqty * OILPRICE
+ $sparkqty * SPARKPRICE; echo 'Subtotal: $'.number_format($totalamount,2).'<br />'; $taxrate = 0.10; // local sales tax is 10%
$totalamount = $totalamount * (1 + $taxrate);
echo 'Total including tax: $'.number_format($totalamount,2).'<br />'; ?>
</body>
</html>

调试演示

在PHP中打断点,浏览器触发断点

XAMPP + PhpStorm + Xdebug本地实验环境搭建的更多相关文章

  1. PhpStorm Xdebug远程调试环境搭建原理分析及问题排查

    2017年05月26日  经验心得 目录   一. 环境介绍 二. 远程环境配置 2.2 Xdebug安装 2.3 配置 三. 本地phpstorm配置 3.1 下载远程代码 3.2 添加php解释器 ...

  2. 论持久战之PHPStorm Xdebug Remote 调试环境搭建(不依赖本地环境)

    最近公司自己搭建了一个资源管理平台,哈哈,当然是我在github上找的,后台用PHP开发.个人觉得写得非常nice,web页面几乎模拟了真实OS,有兴趣的朋友下载部署体验https://github. ...

  3. [xDebug] PhpStorm Xdebug远程调试环境搭建

    对于简单的工程,直接print_r();exit()已经足够,但是对于大型项目有时就有点力不从心.. 1,环境介绍 本地:windows10(192.168..)+ phpstorm8远程:Cento ...

  4. centos7+nginx 1.9.0+php-fpm+phpstorm+xdebug+vmware开发环境搭建

    1.php-fpm yum install php-fpm 默认配置在本地9000端口监听 service php-fpm restart启动 2.nginx 1.9.0 需先安装gcc zlib o ...

  5. LVS本地实验环境搭建

    文中实验需要使用以下软件: CentOS的镜像 Virtual Box GNS3 0.实验前的准备工作 0.1.修改yum源 为了方便安装软件,我们设置yum源为公司yum源 1.直接复制公司机器上的 ...

  6. 本地环境 XAMPP+phpStorm+XDebug+chrome配置和断点调试 注册方法

    我的安装环境:XAMPP版本号V3.1.0 ;phpStorm版本8.0.3;windowsxp 32bit.您老人家先过目一下,不然怕影响意义. XAMPP.phpStorm 都直接安装在了D盘根目 ...

  7. https,https的本地测试环境搭建,asp.net结合https的代码实现,http网站转换成https网站之后遇到的问题

    一:什么是https SSL(Security   Socket   Layer)全称是加密套接字协议层,它位于HTTP协议层和TCP协议层之间,用于建立用户与服务器之间的加密通信,确保所传递信息的安 ...

  8. 【转】https,https的本地测试环境搭建,asp.net结合https的代码实现,http网站转换成https网站之后遇到的问题

    正需要这个,写的很好,就转过来了 转自: http://www.cnblogs.com/naniannayue/ 一:什么是https SSL(Security   Socket   Layer)全称 ...

  9. 操作系统内核Hack:(一)实验环境搭建

    操作系统内核Hack:(一)实验环境搭建 三四年前,心血来潮,入手<Orange's:一个操作系统的实现>学习操作系统内核,还配套买了王爽的<汇编语言(第二版)>和<80 ...

随机推荐

  1. cheerio 服务器端的jquery

    cheerio https://cheerio.js.org/ Fast, flexible, and lean implementation of core jQuery designed spec ...

  2. 类加载器ClassLoader源码解析

    1.ClassLoader作用 类加载流程的"加载"阶段是由类加载器完成的. 2.类加载器结构 结构:BootstrapClassLoader(祖父)-->ExtClassL ...

  3. Flask 学习(三)路由介绍

    Flask路由规则都是基于Werkzeug的路由模块的,它还提供了很多强大的功能. 两种添加路由的方式 方式一: @app.route('/xxxx') # @decorator def index( ...

  4. maven-archetype-plugin 的正确打开方式

    1.  准备好一个编辑好的模板工程 2. 在 pom.xml 中添加 maven-archetype-plugin 插件 <plugin> <groupId>org.apach ...

  5. kubernetes reference

    hyperkube在kubernetes pod里面执行kubernetes命令(例如kubectl) https://feisky.gitbooks.io/kubernetes/components ...

  6. Any Video Converter Pro for Mac注册码

    Any Video Converter Pro for Mac注册码:name:www.macmofo.comsn:000016-D84U8Q-8BN16B-WP2BV6-9RA73A-X7D4V3- ...

  7. express脚手架重建node项目

    安装express 和express-generator cnpm install express express-generator -g express demo1 创建demo1项目, 进入项目 ...

  8. 【记录】【java】反射设值取值

    1.设值 /** * 根据属性名设置属性值 * * @param fieldName * @param object * @return */ public boolean setFieldValue ...

  9. JPA中JpaRepository的使用

    JAP中JpaRepository的使用方法 转载:https://www.cnblogs.com/amberbar/p/10261599.html转载:https://www.cnblogs.com ...

  10. SSM整合学习 四

    事务管理 一:初步理解 理解事务之前,先讲一个你日常生活中最常干的事:取钱. 比如你去ATM机取1000块钱,大体有两个步骤:首先输入密码金额,银行卡扣掉1000元钱:然后ATM出1000元钱.这两个 ...