• Resolved graeme42

    (@graeme42)


    I’ve seen a few threads on a related topic to this, but could’t find a resolution to my particular issue. Last week my host upgraded the PHP version to 8 and when I checked the website everything was fine. A day or so later I went to the site and received…
    Warning: Constant ABSPATH already defined in /graeme-skinner/wordpress/wp-config.php on line 28

    So far I’ve tried a few things including a manual update of WordPress, any ideas?

    Thanks
    Graeme

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • If you can share the wp-config.php file code, i can find the issue. It seems something wrong in the config file. share the config file code or at least Screenshot

    Have a look in the wp-config.php file. You’ll find it using the control panel provided by your host (eg cPanel). Use the File Manager to check for the file in the same level as the /wp-content/ directory. Are there two lines that include ABSPATH?

    I wouldn’t advise you to share the actual content of that file as it contains sensitive information such as passwords.

    Thread Starter graeme42

    (@graeme42)

    Thanks for the replies, here’s the wp-config with the database/password removed…

    <?php
    // ** MySQL settings ** //
    define('WP_CACHE', true); //Added by WP-Cache Manager
    define('DB_NAME', '******');    // The name of the database
    define('DB_USER', '******');     // Your MySQL username
    define('DB_PASSWORD', '*******'); // ...and password
    define('DB_HOST', '******');    // 99% chance you won't need to change this value
    define('DB_CHARSET', 'utf8');
    define('DB_COLLATE', '');
    
    // You can have multiple installations in one database if you give each a unique prefix
    $table_prefix  = 'wp_';   // Only numbers, letters, and underscores please!
    
    // Change this to localize WordPress.  A corresponding MO file for the
    // chosen language must be installed to wp-content/languages.
    // For example, install de.mo to wp-content/languages and set WPLANG to 'de'
    // to enable German language support.
    define ('WPLANG', '');
    
    define( 'UPLOADS', 'wp-content/'.'uploads' );
    
    
    /* That's all, stop editing! Happy blogging. */
    
    
    /* That's all, stop editing! Happy publishing. */
    
    define('ABSPATH', dirname(__FILE__).'/');
    require_once(ABSPATH.'wp-settings.php');
    ?>
    

    Thanks
    Graeme

    Take a backup of the file first.

    Then, remove those last three lines of code:

    define('ABSPATH', dirname(FILE).'/');
    require_once(ABSPATH.'wp-settings.php');
    ?>

    And replace with:

    if ( !defined('ABSPATH') )
    define('ABSPATH', dirname(FILE).'/');

    require_once(ABSPATH.'wp-settings.php');
    ?>

    Thread Starter graeme42

    (@graeme42)

    Thanks for that, worked a treat.

    Great!

    Thanks for the clear instructions. Unfortunately, doing this fix did not resolve our problem. My client uses an old MacBook with High Sierra, and I use a new MacBook with Ventura. Before I made the fix he got the error; I did not. I told him to upgrade, and now he has Catalina on his MacBook, but the problem did not go away for him. Catalina may be as high as his MacBook will go. (Catalina is 10.15; next comes OS 11.)

    Any other suggestions? Is it just the MacOS? (He doesn’t have a PC.)

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Constant ABSPATH already defined ?’ is closed to new replies.