XAMPP + PhpStorm + Xdebug本地实验环境搭建
参考:
下载合适的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

指定项目部署位置

浏览器配置
在适当浏览器上安装插件,这里
- easiest Xdebug for Firefox:这个扩展是Firefox上用于使得与IDE一起调试起来更加容易。你可以在https://addons.mozilla.org/en-US/firefox/addon/the-easiest-xdebug/上找到这个扩展.
- Xdebug Helper for Chrome:这个扩展是运行在Chrome浏览器上的,它将会帮助你通过点击一下按钮就可以允许/禁止调试和性能分析。你可以在https://chrome.google.com/extensions/detail/eadndfjplgieldjbigjakmdgkmoaaaoc找到这个扩展.
- Xdebug Toggler for Safari:这个扩展是运行在Safari上的,允许你在Safari中自动的开始Xdebug调试过程,你可以在Github上找到这个扩展https://github.com/benmatselby/xdebug-toggler.
- Xdebug launcher for Opera:这个扩展是运行在Opera上的,它允许你在Xdebug上开启一个Xdebug会话。
以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本地实验环境搭建的更多相关文章
- PhpStorm Xdebug远程调试环境搭建原理分析及问题排查
2017年05月26日 经验心得 目录 一. 环境介绍 二. 远程环境配置 2.2 Xdebug安装 2.3 配置 三. 本地phpstorm配置 3.1 下载远程代码 3.2 添加php解释器 ...
- 论持久战之PHPStorm Xdebug Remote 调试环境搭建(不依赖本地环境)
最近公司自己搭建了一个资源管理平台,哈哈,当然是我在github上找的,后台用PHP开发.个人觉得写得非常nice,web页面几乎模拟了真实OS,有兴趣的朋友下载部署体验https://github. ...
- [xDebug] PhpStorm Xdebug远程调试环境搭建
对于简单的工程,直接print_r();exit()已经足够,但是对于大型项目有时就有点力不从心.. 1,环境介绍 本地:windows10(192.168..)+ phpstorm8远程:Cento ...
- 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 ...
- LVS本地实验环境搭建
文中实验需要使用以下软件: CentOS的镜像 Virtual Box GNS3 0.实验前的准备工作 0.1.修改yum源 为了方便安装软件,我们设置yum源为公司yum源 1.直接复制公司机器上的 ...
- 本地环境 XAMPP+phpStorm+XDebug+chrome配置和断点调试 注册方法
我的安装环境:XAMPP版本号V3.1.0 ;phpStorm版本8.0.3;windowsxp 32bit.您老人家先过目一下,不然怕影响意义. XAMPP.phpStorm 都直接安装在了D盘根目 ...
- https,https的本地测试环境搭建,asp.net结合https的代码实现,http网站转换成https网站之后遇到的问题
一:什么是https SSL(Security Socket Layer)全称是加密套接字协议层,它位于HTTP协议层和TCP协议层之间,用于建立用户与服务器之间的加密通信,确保所传递信息的安 ...
- 【转】https,https的本地测试环境搭建,asp.net结合https的代码实现,http网站转换成https网站之后遇到的问题
正需要这个,写的很好,就转过来了 转自: http://www.cnblogs.com/naniannayue/ 一:什么是https SSL(Security Socket Layer)全称 ...
- 操作系统内核Hack:(一)实验环境搭建
操作系统内核Hack:(一)实验环境搭建 三四年前,心血来潮,入手<Orange's:一个操作系统的实现>学习操作系统内核,还配套买了王爽的<汇编语言(第二版)>和<80 ...
随机推荐
- Spring+SpringMVC+Spring Data JPA完美整合
使用Maven实现SSS框架的整合. 方便记录,专门建了一个pom项目用来整合SSS框架所用的jar包 1.POM项目,作为父级项目,记录整个整合中的依赖jar包pom文件 <project x ...
- 配置Pods和containers--为Containers和Pods分配CPU资源
指定CPU请求和CPU限制 要为容器指定CPU请求,在容器资源清单中使用resources:requests字段.要指定CPU限制,使用resources:limits. cpu-request-li ...
- c# 导出excel的三种方式
第一种:流导出 SaveFileDialog exe = new SaveFileDialog(); exe.Filter = "Execl files (*.xls)|*.xls" ...
- CentOS / RHEL 内核升级
1. 查看当前内核版本 [root@192.168.118.11 ~]#cat /etc/redhat-release CentOS Linux release 7.7.1908 (Core) [ro ...
- python安装 错误 “User installations are disabled via policy on the machine”
解决方法一: 1.在运行里输入 gpedit.msc 2.计算机配置管理>>管理模板>>windows组件>>windows Installer>> ...
- CentOS7.5 使用 kubeadm 安装配置 Kubernetes1.12(四)
在之前的文章,我们已经演示了yum 和二进制方式的安装方式,本文我们将用官方推荐的kubeadm来进行安装部署. kubeadm是 Kubernetes 官方提供的用于快速安装Kubernetes集群 ...
- web基础---->script标签的特殊使用
今天要讲的就是怎样使用<script>去请求一个servlet,加载一些js资源以及额外的逻辑处理: 目录: JS的引入的几种方式 在script的标签中引入Servlet 动态引入JS的 ...
- keystone源码阅读--python函数
按照setup.sfg文件中[entry_poubts]中的声明前后阅读: 1.cmd.manage:main os.path.join(path,name):连接目录与文件名或目录os.path.e ...
- 031 SSM综合练习07--数据后台管理系统--用户详情查询
1.用户详情查询流程分析 2.代码实现 (1)user-list.jsp页面部分代码 点击jsp页面中的详情按钮,发送请求到UserController.java <!--数据列表--> ...
- MYSQL --Subquery returns more than 1 row查询结果多于一行
Subquery returns more than 1 row表示子查询返回了多行数据 例如: select * from table1 where table1.colums=(select co ...