The process is quite simple. Once you create your PHP code, simply upload it to anywhere within your public_html directory and it will be executed when going to the URL. For a facebook app, you just need to point the canvas URL to the page on your site.
For example, if you wrote the following code:
and your site was Myfacebookapp.com, upload the file to public_html/facebook.php and your canvas URL would be www .myfacebookapp.com/facebook.php
echo "This is where my facebook app will go";