Skip to content

How do I configure buggregator for a vanilla PHP app? #206

Answered by butschster
nsrosenqvist asked this question in Q&A
Discussion options

You must be logged in to vote

Hey! To configure var dumper for a vanilla PHP application, you just need to use $_SERVER variables. Check this out: Var Dumper Configuration.

Here's a quick example:

// Plain PHP
$_SERVER['VAR_DUMPER_FORMAT'] = 'server';
$_SERVER['VAR_DUMPER_SERVER'] = '127.0.0.1:9912';

You can also set these variables using a bash script.

#!/bin/bash

# Set environment variables for var dumper
export VAR_DUMPER_FORMAT="server"
export VAR_DUMPER_SERVER="127.0.0.1:9912"

For xhprof, it's a good idea to add a setup section for vanilla PHP applications. Thanks for the suggestion! It's not too hard. Just use the spiral-packages/profiler composer package.

Here's an example:

use SpiralPackages\Profiler\Profiler;

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@nsrosenqvist
Comment options

@butschster
Comment options

@nsrosenqvist
Comment options

@nsrosenqvist
Comment options

@nsrosenqvist
Comment options

Answer selected by butschster
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
help wanted Extra attention is needed
2 participants