WordPress.org

Ready to get started?Download WordPress

Forums

ABSPATH question (8 posts)

  1. Niteblade
    Member
    Posted 5 years ago #

    I have quick ABSPATH question here.

    In wp-load.php:

    /** Define ABSPATH as this files directory */
    define( 'ABSPATH', dirname(__FILE__) . '/' );

    It seems to me that the value of ABSPATH is being defined with the addition of a trailing slash, '/'.

    Also in wp-load.php

    // Die with an error message
    require_once( ABSPATH . '/wp-includes/classes.php' );
    require_once( ABSPATH . '/wp-includes/functions.php' );
    require_once( ABSPATH . '/wp-includes/plugin.php' );

    Now since ABSPATH has been defined with a trailing slash, '/', then:

    Wouldn't this code:

    // Die with an error message
    require_once( ABSPATH . '/wp-includes/classes.php' );
    require_once( ABSPATH . '/wp-includes/functions.php' );
    require_once( ABSPATH . '/wp-includes/plugin.php' );

    Appear as:

    // Die with an error message
    require_once( '/home/xxx/public_html//wp-includes/classes.php' );
    require_once( '/home/xxx/public_html//wp-includes/functions.php' );
    require_once( '/home/xxx/public_html//wp-includes/plugin.php' );

    Notice double slashes, '//', in the above code ... and this is just in one file, wp-load.php. What about all the other references to ABSPATH found in all the other files inside the /wp-admin/ directory?

    Am I misinterpreting something in the code here?

  2. Niteblade
    Member
    Posted 5 years ago #

    Is there a conflict between APC v3.1.2 and WP v2.7 ?

  3. Niteblade
    Member
    Posted 5 years ago #

    Yes there is.

    APC v3.0.19 = Works fine with WP v2.7.
    APC v3.1.2 = Makes WP v2.7 FAIL when accessing admin menu.

  4. jalenack
    Member
    Posted 5 years ago #

    Arg - had the same problem. Very frustrating to debug. Was using APC 3.0.14 and was failing.

  5. jalenack
    Member
    Posted 5 years ago #

    funny, I tried pecl install apc, it pulled 3.0.19 and that failed for me.

    Could it be resolved with a different APC config?

  6. jamessnell
    Member
    Posted 5 years ago #

    Ah haw! I've been trying to figure out where the hell ABSPATH is being defined. I'm running on Windows and thus for me, ABSPATH on my box looks like:
    C:\wamp\www/

    This is resulting in some code in a plugin failing:
    define("FORMBUILDER_PLUGIN_URL", FORMBUILDER_BLOG_URL . str_replace(ABSPATH, "/", FORMBUILDER_PLUGIN_PATH));

    As, in this case "FORMBUILDER_PLUGIN_PATH" is coming out as:
    http://dev0C:\wamp\www\wp-content\plugins\formbuilder\

    And thus, the ABSPATH string isn't found in there.

    /facepalm

  7. storkontheroof
    Member
    Posted 4 years ago #

    Same problem here too with plugins failing while developing on a windows machine!

    In my case it's WP Post Thumbnail 0.2 beta that won't work without some tweaking.

    This wouldn't be the case if the trailing slash wouldn't be added while defining ABSPATH.

    Hope this get's straightened out in some future release of WordPress.

    Regards

  8. beastmaster
    Member
    Posted 4 years ago #

    Hey Storkontheroof - What did you do to tweak the WP Post Thumbnail 0.2 beta. I'm running WordPress on a localhost and after I choose my image to crop I'm stuck on "Loading..." which prevents me from cropping?

Topic Closed

This topic has been closed to new replies.

About this Topic