Title: How do I require_once()?
Last modified: August 19, 2016

---

# How do I require_once()?

 *  [Josh Sommers](https://wordpress.org/support/users/citricguy/)
 * (@citricguy)
 * [17 years, 9 months ago](https://wordpress.org/support/topic/how-do-i-require_once/)
 * I’m trying to require_once a file in another directory in a WP plugin. I always
   get “This plugin has been deactivated because your changes resulted in a fatal
   error.” when I activate the plugin. When I remove require_once() everything works
   fine (well not ‘fine’) but there are no errors. This is just the piece of the
   code that I’m having trouble with. 🙂
 * Is there another way to include an external file in a WP plugin? (as for the 
   file to be included, it’s at “/home/DIR/public_html/SITE/FOLDER/global.php”)
 * <?php
    $vwd = ‘/home/DIR/public_html/SITE/FOLDER’; $cwd = getcwd(); chdir($vwd);//
   only the next line causes a fatal error. require_once(‘./global.php’); chdir(
   $cwd); ?>

The topic ‘How do I require_once()?’ is closed to new replies.

 * 0 replies
 * 1 participant
 * Last reply from: [Josh Sommers](https://wordpress.org/support/users/citricguy/)
 * Last activity: [17 years, 9 months ago](https://wordpress.org/support/topic/how-do-i-require_once/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
