Title: PHP working directory, WordPress issues
Last modified: August 20, 2016

---

# PHP working directory, WordPress issues

 *  [mjmfxmike](https://wordpress.org/support/users/mjmfxmike/)
 * (@mjmfxmike)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/php-working-directory-wordpress-issues/)
 * Hello everyone, I’ve been debugging this for hours now, and I think I just need
   some help from someone that is more experienced with directory coding than myself.
   I get the following warnings:
 * Warning: require_once(./admin-header.php) [function.require-once]: failed to 
   open stream: No such file or directory in /home/mjmfxcom/public_html/xsv/wp-admin/
   themes.php on line 57
 * Fatal error: require_once() [function.require]: Failed opening required ‘./admin-
   header.php’ (include_path=’.:/usr/lib/php:/usr/local/lib/php’) in /home/mjmfxcom/
   public_html/xsv/wp-admin/themes.php on line 57
 * If I remove the ‘./’ from the includes it’s kosher again.
 * Basically what I’ve done is write a function that automatically registers and
   enques stylesheets and js files so I don’t have to do it manually for every theme
   I write. Here’s that function:
 * _[Code moderated as per the [Forum Rules](http://codex.wordpress.org/Forum_Welcome).
   Please use the [pastebin](http://wordpress.pastebin.com/)]_
 * I’m 99% sure it’s because I’ve left the working directory as something it’s not
   supposed to be, but my understanding was that closedir() reset the working directory.
   Should I set it to the root WP directory rather than just closing it?
 * Also, the function is rough by all means, but if you spot ways to improve it 
   I’m all ears ;).

 The topic ‘PHP working directory, WordPress issues’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [mjmfxmike](https://wordpress.org/support/users/mjmfxmike/)
 * Last activity: [15 years, 4 months ago](https://wordpress.org/support/topic/php-working-directory-wordpress-issues/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
