使用远程服务器设置Xdebug和PHPStorm [英] Setup Xdebug and PHPStorm with remote server

查看:97
本文介绍了使用远程服务器设置Xdebug和PHPStorm的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在远程服务器上使用Xdebug和PHPStorm调试PHP脚本,并且对于远程调试来说还很陌生.我没有对服务器的完全访问权限,但是可以通过FTP(不是SFTP)访问大多数文件(例如,我无法访问php.ini).

I'm trying to debug a PHP script using Xdebug and PHPStorm on a remote server, and am quite new to remote debugging. I do not have full access to the server but have FTP (not SFTP) access to most of the files (I can't get to php.ini for example).

Xdebug已根据其网站上的向导正确安装在服务器上,并使用默认值.

Xdebug is installed on the server correctly according to the wizard on their website and uses default values.

我已经下载了所有项目文件,并在一个项目中对其进行了设置,该项目用于部署.效果很好.

I have all project files downloaded and setup in a project, which is setup for deployment. This works fine.

要设置调试程序,我已经在本地机器(显然不是远程服务器)上安装了WAMP,并将其设置为PHP解释器.它使用与远程服务器相同版本的PHP.

To setup debugging I've installed WAMP on my local box (not the remote server, obviously) and set it as my PHP interpreter. It uses the same version of PHP as the remote server.

我设置了一个断点,并尝试通过将PHPStorm设置为侦听并使用书签设置浏览器以开始调试来建立连接.它没有用,因此我随后尝试在运行>编辑配置中设置新的PHP远程调试服务器. 验证远程环境"按钮显示远程主机:本地主机".我仍然无法通过设置为侦听,或者单击我设置的服务器上的调试",或两者都无法建立连接.

I set a breakpoint and tried to establish the connection by setting PHPStorm to listen and using the bookmarklet to set the browser to start debugging. It didn't work so I then tried to setup a new PHP Remote Debug server in run > edit configurations. The "Validate remote environment" button says "Remote host: localhost". I'm still not able to get a connection either by setting to listen, or clicking debug with the server I setup, or both.

我需要怎么做才能使PHPStorm建立连接?

What do I need to do to get PHPStorm to establish the connection?

我正在调试Magento模块.

I am debugging a Magento module.

如果需要在远程服务器上进行任何更改,我可以请求它们,但我目前的理解是远程服务器设置正确,问题出在我和我的设置上.

If any changes need to be made on the remote server I can request them, but my current understanding is that the remote server is setup correctly, and the problem is me and my setup.

从xdebug.org向导中获取有关远程服务器的信息-

from the xdebug.org wizard about the remote server-

量身定制的安装说明

Tailored Installation Instructions

摘要

  • 已安装Xdebug:2.2.2
  • 服务器API:FPM/FastCGI
  • Windows:否
  • Zend服务器:否
  • PHP版本:5.3.24
  • Zend API编号:220090626
  • PHP API编号:20090626
  • 调试版本:否
  • 线程安全构建:否
  • 配置文件路径:/etc
  • 配置文件:/etc/php.ini
  • 扩展目录:/usr/lib64/php/modules
  • Xdebug installed: 2.2.2
  • Server API: FPM/FastCGI
  • Windows: no
  • Zend Server: no
  • PHP Version: 5.3.24
  • Zend API nr: 220090626
  • PHP API nr: 20090626
  • Debug Build: no
  • Thread Safe Build: no
  • Configuration File Path: /etc
  • Configuration File: /etc/php.ini
  • Extensions directory: /usr/lib64/php/modules

我想发布一些屏幕截图,但我只是一个代表而已.

edit 2: I wanted to post some screen caps, but I'm a single rep point shy.

我已经使用IDE Key PHPSTORM进行了尝试,但都没有尝试过.都不起作用.

I've tried it with both the IDE Key PHPSTORM and none. neither worked.

这是phpinfo()的Xdebug部分.您也可以在 Google文档此处上阅读该书具有完整的格式,因此更容易遵循:

here is the Xdebug section of phpinfo(). You can also read it on a google doc here that has the formatting intact, so it's much easier to follow:

xdebug

xdebug support  enabled
Version 2.2.2
IDE Key PHPSTORM

Supported protocols Revision
DBGp - Common DeBuGger Protocol $Revision: 1.145 $

Directive   Local Value Master Value
xdebug.auto_trace   Off Off
xdebug.cli_color    0   0
xdebug.collect_assignments  Off Off
xdebug.collect_includes On  On
xdebug.collect_params   0   0
xdebug.collect_return   Off Off
xdebug.collect_vars Off Off
xdebug.coverage_enable  On  On
xdebug.default_enable   On  On
xdebug.dump.COOKIE  no value    no value
xdebug.dump.ENV no value    no value
xdebug.dump.FILES   no value    no value
xdebug.dump.GET no value    no value
xdebug.dump.POST    no value    no value
xdebug.dump.REQUEST no value    no value
xdebug.dump.SERVER  no value    no value
xdebug.dump.SESSION no value    no value
xdebug.dump_globals On  On
xdebug.dump_once    On  On
xdebug.dump_undefined   Off Off
xdebug.extended_info    On  On
xdebug.file_link_format no value    no value
xdebug.idekey   no value    no value
xdebug.max_nesting_level    100 100
xdebug.overload_var_dump    On  On
xdebug.profiler_aggregate   Off Off
xdebug.profiler_append  Off Off
xdebug.profiler_enable  Off Off
xdebug.profiler_enable_trigger  Off Off
xdebug.profiler_output_dir  /tmp    /tmp
xdebug.profiler_output_name cachegrind.out.%p   cachegrind.out.%p
xdebug.remote_autostart Off Off
xdebug.remote_connect_back  Off Off
xdebug.remote_cookie_expire_time    3600    3600
xdebug.remote_enable    On  On
xdebug.remote_handler   dbgp    dbgp
xdebug.remote_host  localhost   localhost
xdebug.remote_log   /var/log/xdebug.log /var/log/xdebug.log
xdebug.remote_mode  req req
xdebug.remote_port  9000    9000
xdebug.scream   Off Off
xdebug.show_exception_trace Off Off
xdebug.show_local_vars  Off Off
xdebug.show_mem_delta   Off Off
xdebug.trace_enable_trigger Off Off
xdebug.trace_format 0   0
xdebug.trace_options    0   0
xdebug.trace_output_dir /tmp    /tmp
xdebug.trace_output_name    trace.%c    trace.%c
xdebug.var_display_max_children 128 128
xdebug.var_display_max_data 512 512
xdebug.var_display_max_depth    3   3

推荐答案

似乎我需要xdebug.remote_connect_back,因为我没有静态IP.我让他们添加它之后,我会再次发布它并不能解决它.

It would seem I need xdebug.remote_connect_back because I don't have a static IP. I'll post again after I have them add it and it doesn't fix it.

这篇关于使用远程服务器设置Xdebug和PHPStorm的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆