I have PHP file and I need to include that PHP file in static page. Where is best place to store that PHP file so I can include it in a static page.

  • 1
    which type of static page you are talking. Is that page created by admin or any other file.
    – Nishant
    Feb 16, 2015 at 8:24
  • I'm voting to close this question as off-topic because if it is totally static page, and PHP file is external, then it has nothing to do with Drupal.
    – Mołot
    Feb 23, 2015 at 21:39

1 Answer 1


If that's your code, transform it into Drupal custom module. If you want use PHP API delivered by external service - transform it into library (move code into sites/all/libraries/yourLibrary) and write custom module which loads files on demand (with Libraries API).

  • What if its not my code and some library like the twitteroauth??
    – ShanjayG
    Feb 23, 2018 at 17:14
  • @SanjokGurung Use Composer to manage your dependencies, either via Composer Manager module, or make use of composer for entire project with github.com/drupal-composer/drupal-project
    – zaporylie
    Feb 28, 2018 at 8:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.