问题描述
我正在尝试使用xdebug设置PHPStorm.每次启动都可以,但是断点不起作用并且上面带有"x"符号.
I'am trying to set up PHPStorm with xdebug. Everyting launches fine, but breakpoints just do not work and have "x" symbol on them.
我正在将 openserver 与PHP 5.4一起使用,并直接在本地Web服务器上编辑文件,因此没有文件映射是必需的.
I'm using openserver with PHP 5.4 and editing files directly on the local web server, so no file mapping is necessary.
我认为,我的问题是Web服务器根目录位于项目根目录下(出于安全原因),而PHPStorm则不然.
I think, that my problem is that web server root is located below the project root directory (for security reasons) and PHPStorm does not that.
项目根目录: C:\ OpenServer \ domains \ mysite
Web服务器根目录(在Nginx中配置): C:\ OpenServer \ domains \ mysite \ httpdocs
Web server root (configured in nginx): C:\OpenServer\domains\mysite\httpdocs
我如何告诉PHPStorm,网络服务器运行的index.php实际上是 C:\ OpenServer \ domains \ mysite \ httpdocs \ index.php ,而不是 C:\ OpenServer \ domains \ mysite \ index.php ?
How do I tell PHPStorm, that the index.php that webserver runs is actually C:\OpenServer\domains\mysite\httpdocs\index.php, but not C:\OpenServer\domains\mysite\index.php?
推荐答案
您必须使用路径映射.您可以在调试服务器配置中找到它
You have to use path mapping. You can find it in debug server configuration
查看官方文档和视频:
- Help page
- PHP Debugging webinar recording
- JIT debugging
- Smart step into
- Simultaneous debug sessions
这篇关于如何告诉PHPStorm调试器我的项目具有除项目根以外的其他文件根的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!