Great point about the newline, that was in the back of my mind to fix.
I use the PHP Execution plugin to allow me to test code directly from a page. Install the plugin, activate, create a new blank page and edit it in HTML mode.
Is the file completely outside of your wordpress installation directory? If so, it might work better for you to create a symlink to it within the wordpress directory and include/require that.
ln -s /path/to/file/myfile.php /word/press/location/plugins/myfile/myfile.php