Title: Help getting correct path for a PHP include
Last modified: August 21, 2016

---

# Help getting correct path for a PHP include

 *  Resolved [krisheinze](https://wordpress.org/support/users/krisheinze/)
 * (@krisheinze)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/help-getting-correct-path-for-a-php-include/)
 * I have a folder on my server at the same level as the wordpress folder in the
   directory tree with content that I want to include in my new WordPress site. 
   I have tried several variations of pathing for my include using this plug-in 
   with no luck. I tried an absolute URL in the include, I tried just a / for a 
   root directory beginning and I tried a relative link with a bunch of ../../../../
   syntax. As far as I can tell, the plugin is expected, but my pathing is just 
   incorrect. I am familiar with using PHP includes just writing my own PHP pages,
   but this is one of my first go-rounds trying to figure out the WordPress system.
 * I can bring up the htm file at the absolute URL so I know that is correct. [http://tongaradio.com/wireready/wire/ads.htm](http://tongaradio.com/wireready/wire/ads.htm).
 * This is the error I see on the website:
    Warning: include(../../../../wireready/
   wire/ads.htm) [function.include]: failed to open stream: No such file or directory
   in /home/tongara/public_html/wordpress/wp-content/plugins/php-code-for-posts/
   PHPPostCode.php(79) : eval()’d code on line 1
 * Can anyone help please? Thanks.
 * [http://wordpress.org/extend/plugins/php-code-for-posts/](http://wordpress.org/extend/plugins/php-code-for-posts/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [krisheinze](https://wordpress.org/support/users/krisheinze/)
 * (@krisheinze)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/help-getting-correct-path-for-a-php-include/#post-3945889)
 * I was able to figure this out using tricks from other support forum questions.
   Instead of trying to figure out the correct path I used this code:
 *     ```
       <?php
       $root = realpath($_SERVER["DOCUMENT_ROOT"]);
       include "$root/wireready/wire/ads.htm";
       ?>
       ```
   
 * The plugin works great. Thanks!

Viewing 1 replies (of 1 total)

The topic ‘Help getting correct path for a PHP include’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/php-code-for-posts_0d1022.svg)
 * [PHP Code for posts](https://wordpress.org/plugins/php-code-for-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/php-code-for-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/php-code-for-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/php-code-for-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/php-code-for-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/php-code-for-posts/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [krisheinze](https://wordpress.org/support/users/krisheinze/)
 * Last activity: [12 years, 10 months ago](https://wordpress.org/support/topic/help-getting-correct-path-for-a-php-include/#post-3945889)
 * Status: resolved