Ubuntu / PHPStorm / Xdebug



我无法让 xdebugUbuntu 12.10PHP5.4 下在 PhpStorm 上工作 在我看来,一切都已启用,但 IDE 不会在断点处停止。 以下是相关参数。

有人可以查看参数以查看我缺少什么吗? 我想知道是否需要打开xdebug.remote_enable。 我正在调试本地文件。 服务器根目录和项目路径相同。

如果我确实需要更改 PHP54 xdebug 参数,我到底应该在 ubuntu 中在哪里执行此操作?

我将以下内容添加到/etc/php5/apache2/php.ini,重新启动 apache,但它们似乎被忽略了。

xdebug.remote_enable=1
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
xdebug.remote_host="localhost"

PHP - I 输出

/etc/php5/cli/conf.d/20-xdebug.ini
xdebug
xdebug support => enabled
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 => Off => Off
xdebug.remote_handler => dbgp => dbgp
xdebug.remote_host => localhost => localhost
xdebug.remote_log => no value => no value
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
命令行

上的"php -i"使用与Apache (/etc/php5/apache2/php.ini)不同的php.ini文件(/etc/php5/cli/php.ini)。确保通过浏览器检查 phpinfo() 以查看是否已设置xdebug.remote_enable。phpinfo() 输出还会告诉您已加载哪些 INI 文件,因此也请检查那里。

然而,一般来说,对于扩展,您希望将扩展的配置文件放在/etc/php5/mods-available 中 - 在这种情况下,您将创建/etc/php5/mods-available/xdebug.ini只需:

xdebug.remote_enable=1

在其中。所有其他设置都应保持不变(因为它们无论如何都是默认值)。

前段时间有帮助的另一个提示。我在虚拟机上有 ubuntu,端口 9000 很忙,PhpStorm 中没有命中断点。所以我写了这个:

xdebug.remote_port=9001

并且相同的端口也应该在PhpStorm调试配置中。希望它能帮助某人节省时间。

最新更新