Use WordPress function in php file

There are two things to do to make this work. First, you have to turn your php file into a template that can be recognized by WordPress. This is simply done by adding the following to the top of your file:

<?php /* Template Name: WPSE Example Template */ ?>

The second thing is, you must make sure this file is not called directly, but through WordPress, so functions like get_header are recognized. This you do by making a page in WP. You can leave everything blank, including the title. Just make sure that you assign your template as the one to be used by this page. Use the permalink generated when you save the page to display it.