Profile PHP with Xdebug
phpDesigner 7 provides support for Xdebug’s profiler. Analyze your code and determine bottlenecks or see which parts of your code are slow and could use a speed boost.
Configuration
Xdebug outputs profiling information in the form of a cachegrind compatible file. In order to view a cachegrind file you must have a program as WinCacheGrind in order to analyze your profiling data installed.
WinCacheGrind can be downloaded free of charge at http://sourceforge.net/projects/wincachegrind
Configure phpDesigner 7 to work with WinCacheGrind:
- On the Tools menu, point to Preferences
- Navigate to Profiler
- Type in the path of where to locate WinCacheGrind (.exe)
To enable the profiler in Xdebug, you must have PHP installed and add the xDebug extension to your PHP configuration.
To enable Xdebug's profiler, add the following line to php.ini in the [Xdebug] section:
xdebug.profiler_enable=on
Specify the Xdebug's profiler output directory, add the following line to php.ini in the [Xdebug] section:
xdebug.profiler_out_dir="..."
Replace ”…” with an absolute path, for example “c:\Program Files\phpDesigner\PHP\Profiler”
Add the same output path in phpDesigner 7:
- On the Tools menu, point to Preferences
- Navigate to Profiler
- Type in the path for the output directory
Usage
- On the Debug menu, click Profile
- Select Xdebug profile, click Ok