问题
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 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.
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.
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.
What do I need to do to get PHPStorm to establish the connection?
Edit:
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.
from the xdebug.org wizard about the remote server-
Tailored Installation Instructions
Summary
- 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.
I've tried it with both the IDE Key PHPSTORM and none. neither worked.
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
回答1:
It is impossible on remote server, because you need configure php.ini, that your server would listen xdebug.
"but have FTP (not SFTP) access to most of the files (I can't get to php.ini for example)."
回答2:
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.
来源:https://stackoverflow.com/questions/29878977/setup-xdebug-and-phpstorm-with-remote-server