Actually, if it is just plain php code that you want to run, you can simply upload the file to some accessible location on your website and specify the web path to run it.
For example, upload serve.php to your theme directory and visit:
http://mywordpresswebsite.com/wp-content/themes/<theme_name_here>/serve.php
Of course, you need to replace <theme_name_here> with the name of the theme folder.
However, if your code in serve.php is not just plain PHP, but needs to interact with Wordpress objects, the execution will produce an error. PHP does not know anything about Wordpress. To see the error, you may want to temporary enable debugging output for your site by finding the .htaccess file in its root directory and appending to it :
php_flag display_errors on
So, in case you do need to interact with your Wordpress site, you need the hack, described by Danijel