WordPress.org

Ready to get started?Download WordPress

Forums

Role Scoper
[resolved] Incorrect basepath (5 posts)

  1. codeninja
    Member
    Posted 3 years ago #

    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.

  2. kevinB
    Member
    Plugin Author

    Posted 3 years ago #

    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.

  3. kevinB
    Member
    Plugin Author

    Posted 3 years ago #

    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"?

  4. robertmaefs
    Member
    Posted 3 years ago #

    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)

  5. kevinB
    Member
    Plugin Author

    Posted 3 years ago #

    Thanks for the tip. I've updated the development code to change all require and include statements to absolute path.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic