Fixing realpath issue when using command in a phar

Applying suggestions.