ero-configuration Web Application Debugging with Xdebug and PhpStorm
1. Install Xdebug
To use Xdebug with PhpStorm for debugging PHP applications, you need to have a PHP development environment configured with Xdebug extension installed. This task is beyond PhpStorm’s control. More information on configuring PHP development environment can be found in our web help.
Make sure that you have Xdebug installed properly. Please note that your Xdebug version should fit the PHP version you have (mind the PHP version number and thread-safe/non-thread-safe option) and installed as zend_extension. Don’t forget to set the xdebug.remote_enable setting to 1 in php.ini file. Detailed information on installing and configuring Xdebug can be found here. You can download the latest version of the Xdebug plugin at its official website. Recommended stable versions are 2.2.1 or 2.1.3.
You can check the configuration by executing php --version in the terminal
Alternatively, execute a page with phpinfo(); PHP function and make sure that you have Xdebug extension enabled. The xdebug section of the document with the installed version should be available.
2. Prepare PhpStorm
Toggle the “Start Listening for PHP Debug Connections” button. Don’t use any run configurations.
Once you've installed and configured Xdebug, you can use the Validating Your Debugging Configuration tool to confirm that the configuration of Xdebug and PhpStorm are compatible.
3. Set a breakpoint in the source code
Apart from setting the breakpoint manually, you can use the option Run | Break at first line in PHP scripts to have an automatic breakpoint at the first line of every PHP script you debug.
4. Activate debugger on server
In order to activate the debugger, you need to set a special GET/POST or COOKIE parameter (click here for details). You can do it manually, but it is much more convenient to use one a special tool such as browser toolbar or bookmarklet for that.
Try our PhpStorm bookmarklets generator and get bookmarklets which will work in any modern browser and allow you to start/stop a debugging session by controlling the Xdebug cookie.
5. Start a debug session in browser
6. Reload the current page
7. Set initial path mappings
Switch to PhpStorm; you'll see the Incoming Connection From Xdebug dialogue. You'll now need to select the path mappings so that PhpStorm can map the remote files on the web server to the local files in your project. If you have a deployment configured, then PhpStorm will offer to configure the mappings based on the paths you've already set in that deployment.
If you have no deployment configured (or if the file mappings in the deployment are different), then you can select a manual file to use for this incoming debugger session.
8. Debug!
After reaching the breakpoint the debugger is suspended. Now let’s investigate the application.
Troubleshooting
The first thing to check is that the Xdebug configuration is compatible with PhpStorm's configuration, you can do that using the Validating Your Debugging Configuration tutorial.
In some cases you may get the error message “Remote file path ‘path/to/script/on/the/server.php’ is not mapped to any file path in project“ or “The script ‘path/to/script/on/the/server.php’ is outside the project.” This means that PhpStorm is not sure which local file corresponds to the specified remote file path.
You can solve this problem quickly. Just set up the necessary path mappings by clicking the relevant link.
参考:https://confluence.jetbrains.com/display/PhpStorm/Zero-configuration+Web+Application+Debugging+with+Xdebug+and+PhpStorm
ero-configuration Web Application Debugging with Xdebug and PhpStorm的更多相关文章
- php Debugging with Xdebug and Sublime Text 3(转)
Debugging – we all do it a lot. Writing code perfectly the first time around is hard and only a few ...
- Web.config Transformation Syntax for Web Application Project Deployment
Web.config Transformation Syntax for Web Application Project Deployment Other Versions Updated: Ma ...
- How to: Set Properties of Web Application Projects
https://msdn.microsoft.com/library/aa983454(v=vs.100).aspx ASP.NET Web application projects share th ...
- Intellij Idea中的Jetty报出Web application not found src/main/webapp错误的解决方案
今天在Intellij Idea中编译项目的时候,运行起来一直会报出如下的错误: Web application not found src/main/webapp 当时感觉应该是什么文件缺少了.所以 ...
- ModSecurity web application firewall (WAF) Research
catalog . 引言 . OWASP ModSecurity Core Rule Set (CRS) Project . Installation mod_security for Apache ...
- Tomcat 开发web项目报Illegal access: this web application instance has been stopped already. Could not load [org.apache.commons.pool.impl.CursorableLinkedList$Cursor]. 错误
开发Java web项目,在tomcat运行后报如下错误: Illegal access: this web application instance has been stopped already ...
- 转:Transform Web.Config when Deploying a Web Application Project
Introduction One of the really cool features that are integrated with Visual Studio 2010 is Web.Conf ...
- 项目跑起来之后,一会儿后台就会报错Illegal access: this web application instance has been stopped already. Could not load [com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask]. The following stack trace
一月 24, 2016 6:42:54 下午 org.apache.catalina.loader.WebappClassLoaderBase checkStateForResourceLoading ...
- this web application instance has been stopped already解决办法
重启tomcat的时候出错 Illegal access: this web application instance has been stopped already. Could not loa ...
随机推荐
- Android动画曲线库AndroidEasingFunctions
Android动画曲线库AndroidEasingFunctions AndroidEasingFunction是基于Easing Function(缓动函数)的Android动画曲线库.它提供了九大 ...
- Windows 7 下如何配置 java 环境变量
安装 JDK.从Oracel官方网站上下载,下载完成后安装. http://www.oracle.com/technetwork/java/javase/downloads/jdk8-download ...
- Stanford CoreNLP使用需要注意的一点
1.Stanford CoreNLP maven依赖,jdk依赖1.8 <dependency> <groupId>edu.stanford.nlp</groupId&g ...
- Codeforces Round #541 (Div. 2) (A~F)
目录 Codeforces 1131 A.Sea Battle B.Draw! C.Birthday D.Gourmet choice(拓扑排序) E.String Multiplication(思路 ...
- [HNOI/AHOI2018]道路
Description: W 国的交通呈一棵树的形状.W 国一共有\(n - 1\)个城市和\(n\)个乡村,其中城市从\(1\)到\(n - 1\) 编号,乡村从\(1\)到\(n\)编号,且\(1 ...
- pymysql 使用twisted异步插入数据库:基于crawlspider爬取内容保存到本地mysql数据库
本文的前提是实现了整站内容的抓取,然后把抓取的内容保存到数据库. 可以参考另一篇已经实现整站抓取的文章:Scrapy 使用CrawlSpider整站抓取文章内容实现 本文也是基于这篇文章代码基础上实现 ...
- (转)JavaWeb学习之Servlet(四)----ServletConfig获取配置信息、ServletContext的应用
[声明] 欢迎转载,但请保留文章原始出处→_→ 文章来源:http://www.cnblogs.com/smyhvae/p/4140877.html [正文] 一.ServletConfig:代表当前 ...
- BZOJ5103 : [POI2018]Róznorodno
从上到下枚举上下底边,那么涉及两行的添加和删除. 首先预处理出对于每一列,每个位置添加和删除时,是否会对往下$k$个里出现这个颜色造成影响. 然后对于每种颜色维护一个长度为$m$的bitset,表示哪 ...
- yii2 数据提供者 dataProvider
数据提供者 dataProvider $dataProvider = new ActiveDataProvider([ 'query' => $query, // 如何来取得数据 'pagina ...
- sublime text3中emmet插件的使用
首先,想要快速编码需 要在编辑器中安装常用插件,下面是emmet插件的使用: html5文档结构的生成方式: 1).!+tab键 2).html:5 +tab键 头部head中meta字符集的生成: ...