[英]PhpStorm remote Xdebug
I've got problems with setting up Remote Web Server Debugging with Xdebug. 使用Xdebug设置远程Web服务器调试时遇到问题。 I keep getting 404 error:
我不断收到404错误:
but actually Xdebug is being detected correctly: 但实际上Xdebug被正确检测到:
How are machines setup 机器如何设置
What works fine at this point 这时什么工作正常
What I already tried 我已经尝试过的
Checking out forwarding/tunnel for SSH Xdebug and PhpStorm remote does not work 检出SSH Xdebug和PhpStorm远程转发/隧道不起作用
Following this : https://help.ubuntu.com/community/SSH/OpenSSH/Configuring . 请遵循以下步骤: https : //help.ubuntu.com/community/SSH/OpenSSH/Configuring 。 I've tried turning this settings on, since were off:
由于已关闭,因此我尝试打开此设置:
AllowTcpForwarding yes X11Forwarding yes
Tried to change settings for both php.ini and xdebug.ini, (both and apart) 试图更改php.ini和xdebug.ini的设置(两者)
zend_extension=/usr/lib/php/20170718/xdebug.so xdebug.remote_autostart = 1 xdebug.remote_enable = 1 xdebug.remote_handler = dbgp xdebug.remote_host = 127.0.0.1 xdebug.remote_log = /tmp/xdebug_remote.log xdebug.remote_mode = req xdebug.remote_port = 9005
DocumentRoot
was setup on /var/www
while my project was somewhere else so I move project to /var/www
and still nothing - but works OK on given IP above. DocumentRoot
也已在/var/www
上安装,因此我将项目移至/var/www
,但仍然没有任何内容-但可以在上述给定IP上正常运行。 I'm out of ideas at this point. 我现在还没主意。
PS I'm newbie to Linux. PS我是Linux的新手。
First of all I'm unable to pinpoint what was exactly the problem, however I've got few ideas looking on what I've changed and it suddenly started to work. 首先,我无法确定到底是什么问题,但是我对更改的内容知之甚少,并且突然开始起作用。
Step by step what I've made in order to make connection work this time. 为了使这次连接正常,请逐步进行操作。
At this point the difference is that: 在这一点上,不同之处在于:
Next thing is Mapping. 接下来是映射。 Once I've setup correct path in Connection tab all I had to do is:
在“连接”选项卡中设置正确的路径后,我要做的就是:
Once the connection is established, There will be list of detected remote CLI Interpreters. 建立连接后,将显示检测到的远程CLI解释器的列表。 I've picked up my Laptop's Ubuntu.
我已经拿起笔记本电脑的Ubuntu。 Again keep an eye on Path mappings, it should be the same Root Path above.
再次注意路径映射,它应该与上面的根路径相同。
Now once You press the marked button in CLI line, You will see new windows. 现在,一旦您在CLI行中按下标记的按钮,您将看到新窗口。 In my case xdebug was detected.
在我的情况下,检测到xdebug。
Press „Open in Editor” 按“在编辑器中打开”
Below are the settings I've got in php.ini: 以下是我在php.ini中获得的设置:
zend_extension = /usr/lib/php/20170718/xdebug.so
xdebug.remote_autostart = 1
xdebug.remote_enable = 1
xdebug.remote_handler = dbgp
xdebug.remote_connect_back = 1
xdebug.remote_host = "192.168.1.100" //This is my Desktop PC IP
xdebug.remote_log = /tmp/xdebug_remote.log
xdebug.remote_mode = req
xdebug.remote_port = 9101 //This is the port under which I want xdebug to work remotely
xdebug.idekey = "PHPSTORM"
Below are settings for my Xdebug.ini file on Ubuntu (the same as above): 以下是我在Ubuntu上的Xdebug.ini文件的设置(与上面相同):
It's worth mentioning that I had 127.0.0.1 as remote_host and Validation tool actually detected my Desktop IP this time. 值得一提的是,我有127.0.0.1作为remote_host,而Validation工具这次实际上检测到了我的桌面IP。
Keep an eye on underlined sections – this are my settings. 请注意带下划线的部分-这是我的设置。 Now go to Validate.
现在转到验证。
Upon pressing Validate, You should see settings like these below. 按下验证后,您应该在下面看到类似的设置。 Again be sure to pick up proper Remote connection.
再次确保获得正确的远程连接。
The rest goes just with the official guide – setup Xdebug extension in browser and start listening for incoming connections. 剩下的只是官方指南-在浏览器中设置Xdebug扩展并开始监听传入的连接。
Below are some useful links that might be helpful in case You will have some other kind of problems. 以下是一些有用的链接,这些链接在您遇到其他问题时可能会有所帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.