我想描述一个WordPress应用程序,以找出加载时间的瓶颈。
xdebug的php.ini配置是通过PuPHPet的config.yaml
设置的:
/etc/php5/conf.d/zzzz_custom.ini:
[XDEBUG]
xdebug.remote_connect_back=1
xdebug.default_enable=1
xdebug.remote_autostart=0
xdebug.remote_enable=1
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.profiler_output_dir=/var/www/xdebug_profiler
xdebug.profiler_enable=1
/var/www/puphpet/config.yaml:
xdebug:
install: '1'
settings:
xdebug.default_enable: '1'
xdebug.remote_autostart: '0'
xdebug.remote_connect_back: '1'
xdebug.remote_enable: '1'
xdebug.remote_handler: dbgp
xdebug.remote_port: '9000'
xdebug.profiler_enable: '1'
xdebug.profiler_output_dir: '/var/www/xdebug_profiler'
Xdebug功能正常。这是php -i | grep xdebug
:
$ php -i | grep xdebug
20:/etc/php5/cli/conf.d/xdebug.ini,
45: with Xdebug v2.1.0, Copyright (c) 2002-2010, by Derick Rethans
747:xdebug
749:xdebug support => enabled
756:xdebug.auto_trace => Off => Off
757:xdebug.collect_assignments => Off => Off
758:xdebug.collect_includes => On => On
759:xdebug.collect_params => 0 => 0
760:xdebug.collect_return => Off => Off
761:xdebug.collect_vars => Off => Off
762:xdebug.default_enable => On => On
763:xdebug.dump.COOKIE => no value => no value
764:xdebug.dump.ENV => no value => no value
765:xdebug.dump.FILES => no value => no value
766:xdebug.dump.GET => no value => no value
767:xdebug.dump.POST => no value => no value
768:xdebug.dump.REQUEST => no value => no value
769:xdebug.dump.SERVER => no value => no value
770:xdebug.dump.SESSION => no value => no value
771:xdebug.dump_globals => On => On
772:xdebug.dump_once => On => On
773:xdebug.dump_undefined => Off => Off
774:xdebug.extended_info => On => On
775:xdebug.file_link_format => no value => no value
776:xdebug.idekey => vagrant => no value
777:xdebug.manual_url => http://www.php.net => http://www.php.net
778:xdebug.max_nesting_level => 100 => 100
779:xdebug.overload_var_dump => On => On
780:xdebug.profiler_aggregate => Off => Off
781:xdebug.profiler_append => Off => Off
782:xdebug.profiler_enable => On => On
783:xdebug.profiler_enable_trigger => Off => Off
784:xdebug.profiler_output_dir => /var/www/xdebug_profiler => /var/www/xdebug_profiler
785:xdebug.profiler_output_name => cachegrind.out.%p => cachegrind.out.%p
786:xdebug.remote_autostart => Off => Off
787:xdebug.remote_connect_back => On => On
788:xdebug.remote_cookie_expire_time => 3600 => 3600
789:xdebug.remote_enable => On => On
790:xdebug.remote_handler => dbgp => dbgp
791:xdebug.remote_host => localhost => localhost
792:xdebug.remote_log => no value => no value
793:xdebug.remote_mode => req => req
794:xdebug.remote_port => 9000 => 9000
795:xdebug.scream => Off => Off
796:xdebug.show_exception_trace => Off => Off
797:xdebug.show_local_vars => Off => Off
798:xdebug.show_mem_delta => Off => Off
799:xdebug.trace_format => 0 => 0
800:xdebug.trace_options => 0 => 0
801:xdebug.trace_output_dir => /tmp => /tmp
802:xdebug.trace_output_name => trace.%c => trace.%c
803:xdebug.var_display_max_children => 128 => 128
804:xdebug.var_display_max_data => 512 => 512
805:xdebug.var_display_max_depth => 3 => 3
我的Chrome Start debugger
书签包含以下代码:
javascript:(/** %40version 0.5.2 */function() %7Bdocument.cookie%3D%27XDEBUG_SESSION%3D%27%2B%27PHPSTORM%27%2B%27%3Bpath%3D/%3B%27%3B%7D)()
我已通过Tools -> Edit Configurations
中的自定义配置设置了Xdebug:
并且在代码的任何位置设置断点时它可以正常工作。
导航到网站然后选择Tools -> Analyze Xdebug Profiler Snapshot
时,我明白了:
这根本没用,而且显然缺乏信息。
有什么想法吗?