Say Goodbye to FirePHP: How to log server info to the Browser Console in 2019

Years ago I was a fanatic of FirePHP to send variables to my Firefox Console. It was the easiest way to debug my apps back there when using vanilla PHP.

Time passed and I didn't develop too much until now!. So when trying to revive past glories, I discovered that FirePHP doesn't work anymore, at least with Firefox Developer Edition.

So what to do? We will use QuantumPHP of course!: Here are the easy steps:



Step 1: Get Firefox Developer Edition (a.k.a Quantum yei!)

Step 2: Go to the code src and put this file in your project:




























Step 3: Use this code:


include ('/php/quantumphp.php');
QuantumPHP::$MODE = 2;
// Optional debug size. Defaults to 5kB
QuantumPHP::$HEADER_LIMIT = 16000;
// Logging strings
QuantumPHP::log('Regular log');
QuantumPHP::warn('Regular warn');
QuantumPHP::error('Regular error');
QuantumPHP::send();

 And youre set!


Help my code is not working!
Check your PHP output_buffering variable. I changed it from 4096 to something more and it started working.

Hope this works. Feels fine to write again!.





























Drupal 8 : Succesfully disable E_DEPRECATED in Wamp 3.1.3

So I was having a hard time in a Drupal 8.2 installation and the new Wamp64 3.1.3.

As I was using PHP 7.2, a lot of deprecated code is running in that old version of Drupal, so I receive a lot of screens like this:

 


My first try was to update the php.ini settings and modify the part of error_reporting

This was the normal way to update that error_reporting stuff long ago in Drupal


Currently using Visual Studio Code - Long Live the empire

But to no avail. As I learned, Drupal somehow change this behaviour to suit his need. So there's a simple way to fix this:

Fixing the E_DEPRECATED

Simply go to your sites/default/settings.php and put this line in the end:

error_reporting(E_ALL & ~E_DEPRECATED);


And that's it. With this code you are overwriting the default settings that drupal use to work.

Also, maybe you're having the same problem with your CRM or WebApp of election. Maybe you should test putting this in your code to see if it's our app overwriting the php.ni settings.

Have a good one!