0Pricing
PHP Academy · Lesson

Profiling PHP with Xdebug

Enable Xdebug profiling and analyze callgrind output to find slow functions.

What is Xdebug?

Xdebug is a PHP extension that provides debugging, code coverage, and profiling capabilities. The profiler records how long every function call takes and how many times it is called.

Installing Xdebug

Install via PECL or package manager.

# Via PECL:
$ pecl install xdebug
# Via apt:
$ apt install php-xdebug
# Verify:
$ php -v | grep Xdebug

All lessons in this course

  1. Profiling PHP with Xdebug
  2. OPcache: Bytecode Caching
  3. Optimizing Database Queries
  4. Memory Management and Performance Tips
← Back to PHP Academy