PHP debug

bcons is your companion for performing debugging tasks, such as logging messages or tracking the values of variables at set points in your code. It also displays errors, warnings, session data, cookies, and payload information.

Discover more

Display PHP debug data in your browser

Tired of using error_log() and cryptic server logs to debug your PHP code?

2024/06/07 09:43:01 [error] 2569#2569: *4160 FastCGI sent in stderr: “PHP message: Current user: 23 ([email protected]), checkout requested for order sd34s8hd; PHP message: Order checkout for user 23; PHP message: Payload: ; PHP message: Array ( [action] => orderCheckout [orderId] => sd34s8hd ) ; PHP message: Session: ; PHP message: Array ( [userId] => 23 ) ; PHP message: Cookies: ; PHP message: Array ( [PHPSESSID] => 2b71e8k6nvlipp78fr5m91c0dc [userLanguage] => en ) ; PHP message: User does not have billing information; PHP message: Array ( [id] => 23 [email] => [email protected] [firstname] => Elaine [lastname] => Marley ) ; PHP message: User last purchase date: null; PHP message: Checking user’s company last purchase date…; PHP message: No records found for company; PHP message: Redirecting to billing info form” while reading response header from upstream, client: 127.0.0.1, server: bcons.local, request: “GET /api/test HTTP/1.1”, upstream: “fastcgi://unix:/run/php/php8.3-fpm.sock:”, host: “bcons.local”

bcons allows you to display debug data in a beautiful and user-friendly console.

Demo componente web consola bcons
Circulo
Circulo

What is bcons

bcons is a debugging tool for PHP with two main goals:

1. To display PHP messages in a clear and organized way.

2. To implement the browser Console API
(https://developer.mozilla.org/en-US/docs/Web/API/console)
for PHP in order to help debug PHP code more efficiently.

Ilustracion bcons

How it works

bcons sends an HTTP header that instructs the PHP code to enable the sending of error and debugging messages to the bcons console.

The bcons console is available as a browser devtools extension or on the bcons website.

Circulo
Circulo

All bcons consoles on this page are live, so feel free to click everywhere!
Ctrl+click on any message element to copy it to the clipboard.

Circulo
Circulo

Instant feedback

for errors and warnings

Any warning or error in your code will be reported to your bcons console, including the source file name, line number, and stack trace.

Circulo
Circulo
Demo componente web consola bcons
Circulo
Circulo

Set Up Your PHP Debugger in 3 Easy Steps

1. Create a bcons account
We have a free-forever plan, no strings attached!

2. Install our browser extension
It adds a panel to the DevTools window where the debug messages are displayed.

3. Include the PHP class in your code
Import the bcons class (available via Composer) and start debugging!

-> Please refer to the Getting Started section of the docs for a step-by-step setup guide.

codigo
Circulo
Circulo

Here’s how the panel with the bcons console looks in your browser’s DevTools window:

mockup

“The most effective debugging tool is still careful thought, coupled with judiciously placed print statements.”

Brian Kernighan, “Unix for Beginners” (1979)

The Console API,
but supercharged!

All the standard methods of the Console API are available, and we have added some of our own.

clr

Clears the console without showing any messages.

clog
Displays a message in one of the 22 predefined colors. Great for making a message stand out among many others.

ping

A simple message that lets you know your program has reached a certain point.

-> Write to us if there is any new method you’d like to have implemented in the API.

imagen ordenador 3

bcons vs Xdebug

bcons is not a replacement for Xdebug. Xdebug is a much more advanced tool that allows you to set breakpoints in the code, step through execution, and use many other advanced features.

bcons only allows you to send messages with data or status information to a console. This is known as “print-f debugging.”
In many cases this is enough to detect issues; when it is not, that’s when tools like Xdebug become necessary.

imagen codigo

Security

bcons is completely secure.
All information is sent encrypted.

Unlike other similar tools, debugging information is not sent as part of the HTML response, so there is no risk of debugging messages ending up in production code. The data is sent encrypted to the bcons console and does not modify the HTTP response in any way.

Debugging information is only generated and sent when the web request is made by an authorized user and includes the required HTTP header.

Safety first for your data

Your data travels end-to-end encrypted from your backend code to the bcons console.

Our browser extension, console and PHP code are open source, so you can audit all the encryption/decryption processes.

imagen seguridad
imagen ordenador 2

Ideal for
full-stack developers

bcons is perfect for full-stack developers because it implements in PHP the Console API widely used in frontend development.

The bcons extension integrates seamlessly with Chrome and Firefox developer tools, allowing you to debug both the frontend and the backend from the same place.

Use it everywhere

PHP Debug with bcons only requires PHP >= 5.3.3, making it the perfect choice for debugging legacy projects (where it is most needed!).

It is available via Composer, but even that is not required (you can just download the PHP class and use it).

We really hope you don’t have to work on PHP code older than 5.3, but if you can live without the data encryption, we’re pretty sure you could make it run even on PHP 4!

-> If you do, please let us know!

bcons is perfect for full-stack developers because it implements in PHP the Console API widely used in frontend development.

The bcons extension integrates seamlessly with Chrome and Firefox developer tools, allowing you to debug both the frontend and the backend from the same place.

imagen ordenador 2

Ideal for
full-stack developers

Use it everywhere

PHP Debug with bcons only requires PHP >= 5.3.3, making it the perfect choice for debugging legacy projects (where it is most needed!).

It is available via Composer, but even that is not required (you can just download the PHP class and use it).

We really hope you don’t have to work on PHP code older than 5.3, but if you can live without the data encryption, we’re pretty sure you could make it run even on PHP 4!

-> If you do, please let us know!

A forever free plan

with affordable upgrades

We have a free plan that you can use forever, which is perfect for hobbyists or if you want to try bcons without any commitment.

If your needs grow, our premium plans are very affordable and have a 30-day free trial period. You can save even more if you choose an annual subscription!

Hobbyist

-> Free forever!
Ideal for exploring all bcons features.

Free

icon projects

1 project

icon users

1 user

icon domains

1 domain

icon consoles

1 console

Freelancer

-> Manage multiple projects without breaking the bank.

2€ /month

icon projects

5 projects

icon users

1 user

icon domains

2 domains

icon consoles

1 console

Startup

-> For small teams with a bright future.

4€ /month

icon projects

5 projects

icon users

5 users

icon domains

5 domains

icon consoles

3 consoles

Enterprise

-> Go big!
Enjoy bcons without any limits.

10€ /month

icon projects

Unlimited projects

icon users

Unlimited users

icon domains

Unlimited domains

icon consoles

Unlimited consoles

Hobbyist

-> Free forever!
Ideal for exploring all bcons features.

Free

icon projects

1 project

icon users

1 user

icon domains

1 domain

icon consoles

1 console

Freelancer

-> Manage multiple projects without breaking the bank.

18€ /year

icon projects

5 projects

icon users

1 user

icon domains

2 domains

icon consoles

1 console

Startup

-> For small teams with a bright future.

36€ /year

icon projects

5 projects

icon users

5 users

icon domains

5 domains

icon consoles

3 consoles

Enterprise

-> Go big!
Enjoy bcons without any limits.

102€ /year

icon projects

Unlimited projects

icon users

Unlimited users

icon domains

Unlimited domains

icon consoles

Unlimited consoles

Hobbyist

-> Free forever!
Ideal for exploring all bcons features.

Free

icon projects

1 project

icon users

1 user

icon domains

1 domain

icon consoles

1 console

Freelancer

-> Manage multiple projects without breaking the bank.

2€ /month

icon projects

5 projects

icon users

1 user

icon domains

2 domains

icon consoles

1 console

Startup

-> For small teams with a bright future.

4€ /month
icon projects

5 projects

icon users

5 users

icon domains

5 domains

icon consoles

3 consoles

Enterprise

-> Go big!
Enjoy bcons without any limits.

10€ /month

icon projects

Unlimited projects

icon users

Unlimited users

icon domains

Unlimited domains

icon consoles

Unlimited consoles

Hobbyist

-> Free forever!
Ideal for exploring all bcons features.

Free

icon projects

1 project

icon users

1 user

icon domains

1 domain

icon consoles

1 console

Freelancer

-> Manage multiple projects without breaking the bank.

18€ /year

icon projects

5 projects

icon users

1 user

icon domains

2 domains

icon consoles

1 console

Startup

-> For small teams with a bright future.

36€ /year

icon projects

5 projects

icon users

5 users

icon domains

5 domains

icon consoles

3 consoles

Enterprise

-> Go big!
Enjoy bcons without any limits.

102€ /year

icon projects

Unlimited projects

icon users

Unlimited users

icon domains

Unlimited domains

icon consoles

Unlimited consoles

Ready to take your PHP Debug
to the next level with bcons?