"Listen" button related functionality are based on evaluation of $_SERVER['SERVER_NAME'] and $_SERVER['SERVER_PORT'] variables, so this variables aren't accesible when running php as CLI. I suppose that you can use 'PHP Remote Debug' run configuration for that.
What if I manually generate those variables (I'm already doing that in my bootstrap files to make other things work)
Yes, it should work in this way. You should generate these variables: $_SERVER['SERVER_NAME']", $_SERVER['SERVER_PORT']" and $_SERVER['REQUEST_URI']. You can generate any value for $_SERVER['REQUEST_URI'] because it doen't have any important sense.
I knew that, I mean what the values were supposed to be. I was already setting SERVER_NAME and SERVER_PORT for my own code. Now, I'm guessing it doesn't matter.
This guy says it should work:
http://stackoverflow.com/questions/761708/will-phpunit-and-xdebug-work-together
Ok, that error was because I had a bug in my code (a fatal error.) Still, when I take it out, I get this;
E_NOTICE: Undefined index: SERVER_PORT
#0 xdebug eval(1)
And it does not work.
Hello Keith,
"Listen" button related functionality are based on evaluation of $_SERVER['SERVER_NAME'] and $_SERVER['SERVER_PORT'] variables, so this variables aren't accesible when running php as CLI.
I suppose that you can use 'PHP Remote Debug' run configuration for that.
Thank you!
As I've stated before, that adds complication to the process that I am not willing to mess with (can't seem to make it work reliably anyway.)
What if I manually generate those variables (I'm already doing that in my bootstrap files to make other things work)?
Keith,
Yes, it should work in this way. You should generate these variables: $_SERVER['SERVER_NAME']", $_SERVER['SERVER_PORT']" and $_SERVER['REQUEST_URI'].
You can generate any value for $_SERVER['REQUEST_URI'] because it doen't have any important sense.
Please report here about results.
Keith,
It is a bug and should be:
Fixed in the next EAP.
Thank you for feedback!
I guess I'm confused. What should those variable values be?
So, are you saying that until this is fixed, there is no way to run XDebug with PHPUnit? I can't get it to work.
Of course, right after I post. I figured out, don't hit SHIFT-ENTER, just ENTER and it works.
Hello Keith,
No, it is just UI issue. Also you can use PHP Unit run configuration.
Hello Keith,
Sorry for delay!
For example:
$_SERVER['SERVER_NAME'] = 'localhost'
$_SERVER['SERVER_PORT'] = port
$_SERVER['REQUEST_URI'] = '/'
I knew that, I mean what the values were supposed to be. I was already setting SERVER_NAME and SERVER_PORT for my own code. Now, I'm guessing it doesn't matter.
Keith,
PhpStorm use values of this variables for getting path mappings settings when you use 'Listen' button.
If you want to imitate web server you can set any values for this variables(the only restriction is that SERVER_PORT should have integer value).