Next, Reload PHP and look at the output of phpinfo().
You know you’re succesful when you see the following near the top:
This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
with Xdebug v2.2.1, Copyright (c) 2002-2012, by Derick Rethan

== Step 3: SSH Tunneling ==

Unless you don’t value your code, you’ll want to setup SSH tunneling.

Otherwise, any determined person with XDebug could conceivably view your source code by hooking up an XDebug instance to your server.

To do this on UNIX-based OS’s you’d run the following command:
$ ssh -N -L 9000:localhost:9000 remotehost

To do this in Windows, I use a program called Tunnelier http://www.bitvise.com/tunnelier

== Step 4: Configure PHPStorm ==

This is the most complex step.
It assumes you already have an existing project setup on a remote server.

Set up PHPStorm’s debugger IDE Key.

Go to Settings -> PHP -> Debug. Make sure it has xdebug using port 9000.

Then above there, go to Settings -> PHP -> Servers. Click Add
Fill in the details and then click “Use path mappings”
Then you need to fill in the path of the project’s code on the remote server.
Hit Apply, then OK.
The final step of configuring PHPStorm is adding a Remote Debug configuration.
Go to Run -> Edit Configurations
Click the plus next to Details.
Right click on PHP Remote Debug, and click Add New Configuration, select PHP Remote Debug again.
I would name it “Remote debug”
Ensure that the IDE Key says “PHPSTORM”.
Hit OK.
== Step 5: Install Debug Bookmarklets ==
The final step is to install the PHPStorm bookmarklets.
Go to http://www.jetbrains.com/phpstorm/marklets/

The user will be redirected to Facebook, but there is no exit; after the call.

Therefore, PHP keeps executing the script, calling validate();

Since validate can only be called once per login attempt, by the time they call it the second time (after logging into Facebook), their session is automatically invalidated.

There

By using proper debugging, I fixed two hard to find bugs in just under 10 minutes.

I hope this has been a good demonstration of the power of proper PHP debugging.

I find that people who use real debugging can find bugs in 10 minutes that would take other devs 3 hours to find.
AND!
If you ever wanted to know how an app worked, all you have to do is set the breakpoint to the first line and step through it.
You’ll see exactly how it works, and it’s a lot easier, faster and fool-proof than trying to mentally work your way through it.