Extending Drupal Functionality to Custom PHP Page I have Drupal 7 site which is working fine. I added a custom PHP page to my site in the root directory of it. I want to extend the Drupal application functionality to that one page so that I can have access to the different Drupal classes and basically extend Drupal through my page. What includes do I need at the top of my page to be able to access the Drupal application as if I were within the Drupal site?
The only file you need to include is '/includes/bootstrap.inc', but you also need to define the DRUPAL_ROOT constant and run drupal_bootstrap() to have access to the API/database/etc.:

define('DRUPAL_ROOT', getcwd());

require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);

// Your code here


It's exactly the same code that you'll find in the standard index.php file, minus a call to menu_execute_active_handler() which isn't necessary if you dont want to build and output a normal Drupal page.