最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

vagrant - XDebug not finding trigger values - Stack Overflow

programmeradmin1浏览0评论

I'm running a test website on PHP8.3 in a Vagrant box using Ubuntu 20.04. This has all been fine.

I want to profile a specific page because I'm getting a major slow-down. So I installed XDebug on the Vagrant box with this set-up:

[XDebug]
zend_extension=xdebug.so

xdebug.mode=profile
xdebug.start_with_request=trigger
xdebug.trigger_value=GOGO
xdebug.discover_client_host=localhost
xdebug.client_port=9003
xdebug.log=/vagrant/logs/xdebug.log

I put the log in that directory to make it accessible outside the vagrant box.

I have tried putting the trigger XDEBUG_TRIGGER=GOGO (and XDEBUG_PROFILE=GOGO, though it shouldn't be needed) in:

  • The website environment variables
  • Exported to the vagrant box environment variables
  • As a query on the URL

And all I ever get is this (with log level 10):

[12613] Log opened at 2024-11-19 11:34:29.633192
[12613] [Config] INFO: Control socket set up succesfully: '@xdebug-ctrl.12613'
[12613] [Config] INFO: Systemd Private Temp Directory is enabled (/tmp/systemd-private-dd3b291ebebd46669a866e2a97c52af1-apache2.service-DxTd0e)
[12613] [Config] DEBUG: Checking if trigger 'XDEBUG_TRIGGER' is enabled for mode 'profile'
[12613] [Config] INFO: Trigger value for 'XDEBUG_TRIGGER' not found, falling back to 'XDEBUG_PROFILE'
[12613] [Config] INFO: Trigger value for 'XDEBUG_PROFILE' not found, so not activating
[12613] Log closed at 2024-11-19 11:34:37.464555

Some things I've read suggest changing the client values to match the vagrant box, but I'm not going outside the box (the log file will be read from outside but that's different).

There was also the suggestion of compatibility issues (from a couple years ago) but I installed the php8.3-xdebug extension so I assume that's fine.

I have also tried setting xdebug.start_with_request to yes. There's no error message but still no profile results, just this:

[12198] Log opened at 2024-11-19 10:59:33.812840
[12198] [Config] INFO: Control socket set up succesfully: '@xdebug-ctrl.12198'
[12198] [Config] INFO: Systemd Private Temp Directory is enabled (/tmp/systemd-private-dd3b291ebebd46669a866e2a97c52af1-apache2.service-UDwGwh)
[12198] Log closed at 2024-11-19 10:59:47.696373

What am I missing?

EDIT: I installed the web server plugin which creates the cookie for the trigger value, and it worked. Although unfortunately the cachegrind file is in /tmp and not the place I wanted.

But at least it's working.

Edit 2: xdebug.output_dir puts the result where I want it.

All done.

发布评论

评论列表(0)

  1. 暂无评论