Skip to content

Instantly share code, notes, and snippets.

@vyspiansky
Last active August 27, 2024 19:57
Show Gist options
  • Save vyspiansky/6114823ef1af492db57ad01e87d8997f to your computer and use it in GitHub Desktop.
Save vyspiansky/6114823ef1af492db57ad01e87d8997f to your computer and use it in GitHub Desktop.
Enable XHProf in Lando

.lando.yml

name: "..."
recipe: lamp
config:
  php: "8.1"
  xdebug: false
services:
  appserver:
    build_as_root:
      - pecl install xhprof
      - docker-php-ext-enable xhprof
    config:
      php: .lando/php.ini
tooling:
  xhprof:
    service: appserver
    cmd: php -r "var_dump(extension_loaded('xhprof'));"

php.ini

xhprof.output_dir=/app/xhprof

File: /path/to/project/.lando/php.ini

*.xhprof logs directory

Directory: /path/to/project/xhprof

Rebuild

lando rebuild -y

Is xhprof extension enabled?

lando xhprof

or

lando php -m | grep xhprof
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment