From the course: Linux for PHP Developers

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Installing webgrind for profiling

Installing webgrind for profiling

From the course: Linux for PHP Developers

Start my 1-month free trial

Installing webgrind for profiling

- [Instructor] One of Xdebug's feature is a profiler, which analyzes program execution. The profiler generates files that can be analyzed with third party tools such as webgrind, which I'll demonstrate. Profiling is even slower than the regular Xdebug performance impact. Therefore, this feature is off by default. We have the option to turn it on all of the time, but that's really not a good idea. There's a more reasonable alternative, on demand, where we can selectively enable profiling for a single page load. Let's start by enabling the trigger for profiling. From the terminal, let's edit the Xdebug configuration. Sudoedit and it's in etc/php/7.0/mods-available and then the file name, xdebug.ini. We're going to add two lines, so press down. First, we'll allow the profiler to be triggered manually. Type xdebug.profiler_enable_trigger equals one and the second, xdebug.profiler_output_dir will be where the profiler will be riding, which will be /tmp/cachegrind. When complete, press…

Contents