简体   繁体   English

PHPStorm,Xdebug和远程调试(在phpstorm中使用FTP)

[英]PHPStorm, Xdebug and remote debugging (using FTP in phpstorm)

First things first: 首先要做的事情:

  • Server is an Apache running on Ubuntu on SunVirtualBox x86 Server是在SunVirtualBox x86上的Ubuntu上运行的Apache
  • Debugging-Server is XDebug Debugging-Server是XDebug
  • Files are downloaded from FTP using phpstorm 使用phpstorm从FTP下载文件

PHP version is PHP版本是

PHP 5.4.9-4ubuntu2.4 (cli) (built: Dec 12 2013 04:26:30) 
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
with Xdebug v2.2.1, Copyright (c) 2002-2012, by Derick Rethans

Important : XDebug is properly configured cause everything works on my localhost. 重要XDebug已正确配置,因为一切都可以在我的localhost上运行。

在此输入图像描述

But I just can't set up remote debug here are all the images and steps I made, PLEASE HELP and advice me. 但我只是无法设置远程调试这里是我所做的所有图像和步骤,请帮助并建议我。

Step 1 - Basic click on Create new project from existing files. 步骤1 - 基本单击从现有文件创建新项目。

第1步

Step 2 - Choose FTP 第2步 - 选择FTP

第2步

Step 3 - Project settings on file system 第3步 - 文件系统上的项目设置

第3步

Step 4 - Setting FTP connection and Advanced - Passive mode 步骤4 - 设置FTP连接和高级 - 被动模式

设置FTP连接和高级 - 被动模式

Step 5 - Run/Debug configuration, choose PHP remote Debug , and typed in Ide key: PHPSTORM 步骤5 - 运行/调试配置,选择PHP远程调试 ,然后键入Ide键:PHPSTORM

运行/调试配置

Step 6 - Servers and validate remote enviroment, here pops out WARNING: No debug extension loaded 步骤6 - 服务器和验证远程环境,这里弹出警告:没有加载调试扩展

服务器并验证远程环境

Step 7 - Php ini configuration. 第7步 - Php ini配置。

Php ini配置。

So in the end.... 所以最后....

1) Is there anything that I had to do on remote server from my client for this thing to work? 1) 我的客户端是否需要在远程服务器上执行此操作才能使用此功能? Maybe install XDEBUG also there, maybe you will find this questions silly, believe me I lost 3 days already in this and I am little frustrated to say the lease. 也许在那里也安装XDEBUG,也许你会发现这个问题很傻,相信我已经在这里失去了3天而且我很沮丧地说出租约。 so please help. 所以请帮忙。

2) I will happily upload more screenshots or answer to any question you might have in order to help me out. 2)我很乐意上传更多截图或回答您可能遇到的任何问题,以帮助我。 I know it is something simple but I am breaking my head over it. 我知道这很简单,但我对此不以为然。

Again please help, I passed certainly 15 pages on remote debug in PHPSTROM and all of them were just not precise enough. 请再次请帮助,我在PHPSTROM中通过了15页远程调试,所有这些都不够精确。 Like you can see in first pictures everything works fine on my localhost. 就像你在第一张照片中看到的一样,我的本地主机上的一切正常。

The main difference between using XDebug on your local machine, and using XDebug with a remote system, is that you have to configure two things: 在本地计算机上使用XDebug和在远程系统上使用XDebug之间的主要区别在于,您必须配置两件事:

1) The xdebug.remote_host on your server outside your network is going to be YOUR IP ADDRESS, as in, what you get if you go to whatismyip.com. 1)网络外部服务器上的xdebug.remote_host将成为您的IP地址,如果您访问whatismyip.com,您将得到什么。 This IP address is prone to change. 此IP地址很容易更改。 (You can use dynamic DNS from certain providers and a hostname instead of an IP if your home IP changes a lot). (如果您的家庭IP发生了很大变化,您可以使用来自某些提供商的动态DNS和主机名而不是IP)。 Anyway, When XDebug starts on the remote server, it becomes the CLIENT looking for YOUR XDEBUG SERVER running on your laptop on port 9000. 无论如何,当XDebug在远程服务器上启动时,它将成为客户端,在端口9000上查找笔记本电脑上运行的XDEBUG SERVER。

This is what confuses so many users of XDebug. 这就是让很多XDebug用户感到困惑的原因。 That then leads to the following: 然后导致以下结果:

2) You have to edit your home/office firewall (presumably this is the traffic cop on the IP you entered into your xdebug.ini or php.ini in step 1) to port forward incoming traffic on port 9000 to your laptop's IP on your home/office network. 2)您必须编辑家庭/办公室防火墙(可能这是您在步骤1中输入xdebug.ini或php.ini的IP上的交通警察),以便将端口9000上的传入流量转发到您的笔记本电脑的IP上家庭/办公室网络。

The best resource about this is (IMO) here: http://matthardy.net/blog/configuring-phpstorm-xdebug-dbgp-proxy-settings-remote-debugging-multiple-users/ 关于这个的最佳资源是(IMO): http//matthardy.net/blog/configuring-phpstorm-xdebug-dbgp-proxy-settings-remote-debugging-multiple-users/

您应该在remotedebug中将debubugger的端口设置为9000,就像在php.ini中一样。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM