Make sure you have the right XDebug version for your version of PHP and add this at the very beginning of your php.ini file:
[xdebug]
zend_extension=full_path_to_your_xdebug.so
xdebug.default_enable=On
xdebug.remote_enable=On
xdebug.remote_handler="dbgp"
xdebug.remote_host="localhost"
xdebug.remote_port=9000
Then do an apachectl graceful
and a phpinfo
and make sure XDebug is present and active. If it is, everything should work fine. I know it does for me.
edit: I answered before reading the entire question.
before running the script you should set the environment variable;
export XDEBUG_CONFIG="idekey=session_name"
It might be possible to do this from php but i cannot test this:
putenv('XDEBUG_CONFIG="idekey=session_name"');
You should make sure that the php binary you are using has the XDebug extension loaded, on my system the apache module has it, but the default CLI interpreter does not, but I run different versions on purpose.
There's some good documentation here
Since the resource loader looks for files in directories and you want to test the loader's correct interaction with these directories, you should mock the filesystem. If you test with a real directory, you are risking outside change to these directories that may affect the test outcome. Using the vfs is also much faster.
Best Solution
I had to make an absolute path using $_SERVER['DOCUMENT_ROOT'] that way no matter what file structure I am on it works. a Truly relative path. lol.