Title: Incorrect basepath
Last modified: August 19, 2016

---

# Incorrect basepath

 *  Resolved [codeninja](https://wordpress.org/support/users/codeninja/)
 * (@codeninja)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/incorrect-basepath/)
 * I have my wordpress dir symlinked to a location outside of the docroot. This 
   plugin incorrectly references the real path rather than the symlinked one causing
   the page to break. URL referenced items are failing because they’re referring
   to items outside of docroot.

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Kevin Behrens](https://wordpress.org/support/users/kevinb/)
 * (@kevinb)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/incorrect-basepath/#post-2060187)
 * I’ll look into getting this fixed. Can you tell me if there were wordpress dir
   references where you saw this happening?
 * Also, was this the cause of the “broken” flag for WP 3.1.2? The commentless “
   broken” feedback is of very little benefit to the plugin developer. In my opinion,
   it should require a corresponding support forum post and link each “broken” vote
   back to that post. This is a critique of the extend/plugins system itself – not
   the commenter.
 *  Plugin Author [Kevin Behrens](https://wordpress.org/support/users/kevinb/)
 * (@kevinb)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/incorrect-basepath/#post-2060200)
 * I’m going to need more details on how to recreate that error because I’m not 
   seeing any problem with a new WP+RS installation in a symlinked directory.
 * > This plugin incorrectly references the real path rather than the symlinked 
   > one causing the page to break
 * What is “the page”?
 * > URL referenced items are failing because they’re referring to items outside
   > of docroot.
 * What do you mean by “URL referenced items”?
 *  [robertmaefs](https://wordpress.org/support/users/robertmaefs/)
 * (@robertmaefs)
 * [15 years ago](https://wordpress.org/support/topic/incorrect-basepath/#post-2060574)
 * i’m having a similar problem i believe.
 * if i go in and change all of the requires and includes in your plugin to require_once(
   dirname(__FILE__).’/lib/file.php’);
    then it works. the problem is there are 
   about 150 of them. The result of getcwd looks like it’s in / or /wp-admin and
   as a result the include fails. It does not appear to be including the file’s 
   directory in the search path for this particular case (but i’ve verified that’s
   working in separate scripts).
 * All relative paths such as require(‘lib/foo.php’) fail with a standard php “can’t
   open stream” error.
    It appears to be some really really weird symlink, php, 
   apache, wordpress thing. I can’t trigger it except in wordpress plugins that 
   do relative includes. Drupal, magento, and regular php just seem to work no problem.
 * So, if you have any idea what could be wrong with my setup that targets only 
   wordpress plugins i’m all ears. Otherwise i think you should probably make it
   a practice to use absolute paths in your includes. I think wordpress best practices
   say you should and my hunch is they’ve made changes that are making this more
   necessary.
 * (I’d love love love to figure out what’s stopping relative includes in the wordpress
   plugin framework though. Five hours and no progress means i wasn’t being sarcastic
   when i asked if you had any ideas why this would be failing)
 *  Plugin Author [Kevin Behrens](https://wordpress.org/support/users/kevinb/)
 * (@kevinb)
 * [15 years ago](https://wordpress.org/support/topic/incorrect-basepath/#post-2060576)
 * Thanks for the tip. I’ve updated the [development code](http://downloads.wordpress.org/plugin/role-scoper.zip)
   to change all require and include statements to absolute path.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Incorrect basepath’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/role-scoper.svg)
 * [Role Scoper (Obsolete - Please install PublishPress Permissions)](https://wordpress.org/plugins/role-scoper/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/role-scoper/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/role-scoper/)
 * [Active Topics](https://wordpress.org/support/plugin/role-scoper/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/role-scoper/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/role-scoper/reviews/)

## Tags

 * [extend](https://wordpress.org/support/topic-tag/extend/)
 * [plugin directory](https://wordpress.org/support/topic-tag/plugin-directory/)

 * 4 replies
 * 3 participants
 * Last reply from: [Kevin Behrens](https://wordpress.org/support/users/kevinb/)
 * Last activity: [15 years ago](https://wordpress.org/support/topic/incorrect-basepath/#post-2060576)
 * Status: resolved