I’m not sure if you’re trying to use WordPress functions outside of the actual WordPress application, but to accomplish this you simply need to do:
require( 'path-to-wordpress/wp-load.php' );
at the top of your file, if the path to the WordPress application is in fact $_SERVER['DOCUMENT_ROOT']
then you would do
require ( $_SERVER['DOCUMENT_ROOT'] . '/wp-load.php' );