Skip to content

Xdebug - Debugger and Profiler Tool for PHP

För de som har problem med PHP och behöver verktyg för att felsöka och profilera sina php filer så är Xdebug ett bra ställe att börja på speciellt om man gör det tillsammans med kCachegrind

För mig del så la jag till detta i min php.ini för apache.

; Set to 1 when you want to enable profiler and kcachegrind
xdebug.profiler_enable = 0
; Where should profiler store files?
xdebug.profiler_output_name = cachegrind.out.%p.%s.%u

; Show exception trace when error occurs
xdebug.show_exception_trace = On
; Print out all local variables if error
xdebug.show_local_vars = 1

; Controls whether the values of the superglobals should be dumped on all error situations (set to Off) or only on the first (set to On).
xdebug.dump_once = On
; Dump the global vars
xdebug.dump_globals = On
; If you want to dump undefined values from the superglobals you should set this setting to On, otherwise leave it set to Off.
xdebug.dump_undefined = On
; Dump REQUEST variable
xdebug.dump.REQUEST = *
; Dump Server variable
xdebug.dump.SERVER = REQUEST_METHOD,REQUEST_URI,HTTP_USER_AGENT

; Trace format
xdebug.trace_format = 0
; No auto tracing, must manualy call trace functions
xdebug.auto_trace = Off
; Where to store trace files
xdebug.trace_output_dir = /home/johan/DiskEtt/traces
; What to name them
xdebug.trace_output_name = trace.%c.%p

; Control what to trace
xdebug.collect_params = 4
xdebug.collect_includes = Off
xdebug.collect_return = Off

Länkar:
Xdebug - Debugger and Profiler Tool for PHP
http://www.splitbrain.org/blog/2008-02/21-understanding_php_code_better_with_xdebug
http://devzone.zend.com/article/2803-Introducing-xdebug

Categories: Uncategorized.