With the help of https://knowthecode.io/labs/lets-build-non-wordpress-sandbox I am going to help you setup a sandbox for all of your non WordPress php projects. Why may I ask to I need this? Have you ever struggled with debugging and wished there was a better way? There is and I am going to show you a way.
The first step will be to install composer to your system. I assume you already have git installed, if not you can skip this step and download the file later rather than use git. First we need composer. We will need to run this from the command line:
You will now have a composer.phar file located in the current directory. I typically rename it to composer and on linux/mac systems change the permissions for the user to execute. I then move it to my local bin directory that is in my path.
Now we are ready to install Whoops Kint and Composer for our sandbox.
If you don’t have git, just download the file from https://github.com/KnowTheCode/Non-WordPress-Sandbox
I am going to show you the big gun first, but we need to edit demo.php first to have the following content:
Let me give you a hint, this code is going to fail badly. But we want it to so we can see what happens.
Ok lets comment out the error and look at kint. Have you ever wondered what was in the php superglobal $_SERVER? Well this is your lucky day.
I hope I have whetted your appetite for learning more about Whoops and Kint. There is a free training class at https://knowthecode.io/labs/lets-build-non-wordpress-sandbox It is about 40 minutes of video and it explains it much better than I did.