Hi,
All examples in the PHP libraries (including the GetRefreshToken.php example) should be run from the command line. In particular, the GetRefreshToken example writes a URL for you to follow to stdout, and then reads the authorization code you type in from stdin.
Please try running the example from the command line and let me know if you still encounter issues.
Thanks,
Josh, AdWords API Team