• On my local development machine I have the following folder structure:

    
    main_home
    |-wordpress (clone of github/wordpress/wordpress)
    |   |-wp-admin
    |   |-wp-includes
    |
    |-wp_content (a custom directory with all my plugins and themes)
        |-themes
        |-plugins
    

    I have the following lines in wp-config

    define( 'WP_CONTENT_DIR', dirname(ABSPATH) . '/wp-content' );
    define( 'WP_CONTENT_URL', WP_HOME . '/wp-content' );

    The wordpress folder is a clone of https://github.com/WordPress/WordPress/ which I use to switch WordPress versions for testing. ie. checkout v5.3 or 5.2.4 or 5.0.7 etc.

    Without the custom WP_CONTENT_DIR defines I get the expected Database Update Required message on /wp-admin/upgrade.php page whenever I checkout different WordPress versions.

    However with my custom WP_CONTENT_DIR config I get the following message: The site is experiencing technical difficulties. on the redirect to /wp-admin/upgrade.php page. With no recourse other than commenting out the defines, updating the database, and then reinstalling my custom content dir.

    I don’t know if this is a support issue. Or if it’s a bug and I should open a ticket for this.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator bcworkz

    (@bcworkz)

    WP_HOME is not yet defined in wp-config.php. Since WP rarely uses the URL, the issue doesn’t show itself much. Define the URL without using WP constants.

    Thread Starter apedog

    (@apedog)

    @bcworkz Thank you but that’s not it.
    I have both WP_SITEURL and WP_HOME defined in my wp-config.php. Right before they’re used in defining WP_CONTENT_DIR.
    Nonetheless I just tested this with a full hardcoded url – and I get the same issue.

    PS. I might have failed to mention this in my initial post, but the issue only arises when trying to access /wp-admin/ pages/url’s. I get redirected to /wp-admin/upgrade.php?_wp_http_referer=%2Fwp-admin%2F with the error message.
    The front-end loads just fine.

    PPS. When switching WordPress to 5.0.x or 5.1.x I don’t even get the technical difficulties message. I just get This page isn’t working - HTTP ERROR 500 from the browser.

    In all cases commenting out the WP_CONTENT_ defines solves the issue.

    Thread Starter apedog

    (@apedog)

    Ok,
    I just tried this with an empty custom wp-content folder – and the issue does not arise. So I’m assuming it’s one of the plugins interfering.

    Investigating further.

    Thread Starter apedog

    (@apedog)

    SOLVED

    It was a problem with an mu-plugin https://github.com/lkwdwrd/wp-muplugin-loader used to load other mu-plugins installed via composer (ie. in sub-folders).
    It does not run on WP_INSTALLING.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Problem upgrading WordPress with custom directory structure’ is closed to new replies.