• Resolved laiconsulting

    (@laiconsulting)


    The mainsite can be accessed properly, however all the subsites show
    Notice: Trying to access array offset on value of type null in /var/www/wordpress/wp-content/plugins/w3-total-cache/Util_Environment.php on line 187
    Error establishing a database connection

    What gives?

    I have cloudfront distribution sitting in front of WordPress if that matters.
    also I Use single network configuration file for all sites.

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

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @laiconsulting

    I am sorry about the issue you are experiencing and I am happy to assist you with this.
    Can you please disable “Use single network configuration file for all sites” save all settings and purge the cache and see if the issue persists?
    Thank you!

    Thread Starter laiconsulting

    (@laiconsulting)

    Hello Marko,

    thanks for the reply.
    Before I try your suggestion, I made the observation that none of the subsite tables wp_x_blah where successfully created, wp_site also isn’t showing any subsites. Perhaps this is not a W3TC issue.
    What’s your opinion?
    What could be the root cause from your experience?

    • This reply was modified 4 years, 8 months ago by laiconsulting.
    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @laiconsulting

    Thank you for the information.
    It seems like W3 Total Cache does not recognize wpmu. Purge the cache and disable W3 Total Cache and see if you are still experiencing the issue and if wp_site is showing any subsites?
    Thank you!

    Thread Starter laiconsulting

    (@laiconsulting)

    I found the root cause. The problem comes from hyperDB, which is not directly w3tc related, but w3tc should shall take cautious since w3tc’s cluster db borrows code from db.php of hyperDB.

    My DB is MySQL5.7
    The default WP charset is utf8mb4. DB_COLLATE is empty as per default wp-config.
    In db.php of hyperdb, if the collate isn’t set, it defaults to utf8mb4-general-ui, which isn’t available in the utf8mb4 charset of my database, hence table creations errored out, and all the bad consequences following it.

    The solution in my case was to specify utf8mb4-unicode-ui in wp-config
    define( ‘DB_COLLATE’, ‘utf8mb4_unicode_ci’ );

    I hope this problem won’t come back to me if I upgrade to MySQL8

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @laiconsulting

    Thank you for the information.
    Glad to know you found the cause of the issue!
    Thank you!

    Thread Starter laiconsulting

    (@laiconsulting)

    Hi Marko,

    I am still getting this error in Util_Environment every couple seconds.
    Could you give a hint on how to debug it?

    [11-Mar-2020 11:06:12 UTC] PHP Notice:  Trying to access array offset on value of type null in /var/www/wordpress/wp-content/plugins/w3-total-cache/Util_Environment.php on line 187
    [11-Mar-2020 11:06:15 UTC] PHP Notice:  Trying to access array offset on value of type null in /var/www/wordpress/wp-content/plugins/w3-total-cache/Util_Environment.php on line 187
    [11-Mar-2020 11:06:22 UTC] PHP Notice:  Trying to access array offset on value of type null in /var/www/wordpress/wp-content/plugins/w3-total-cache/Util_Environment.php on line 187
    [11-Mar-2020 11:06:25 UTC] PHP Notice:  Trying to access array offset on value of type null in /var/www/wordpress/wp-content/plugins/w3-total-cache/Util_Environment.php on line 187
    [11-Mar-2020 11:06:32 UTC] PHP Notice:  Trying to access array offset on value of type null in /var/www/wordpress/wp-content/plugins/w3-total-cache/Util_Environment.php on line 187
    [11-Mar-2020 11:06:35 UTC] PHP Notice:  Trying to access array offset on value of type null in /var/www/wordpress/wp-content/plugins/w3-total-cache/Util_Environment.php on line 187
    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @laiconsulting,

    This looks like a broken blog map file. You should make a backup and delete it and see if the issue persists.
    Thank you!

    Thread Starter laiconsulting

    (@laiconsulting)

    Could you elaborate a bit. What file should I delete?
    Will it be regenerated afterwards?

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @laiconsulting

    It’s in the wp-content/cache/blogs.php
    Yes, it should regenerate, of course, that’s why I asked you to delete it as it might be broken.
    Thank you!

    Thread Starter laiconsulting

    (@laiconsulting)

    Hi Marko,

    thanks for the suggestion.
    Unfortunately, removing the blogs.php didn’t help.
    Do you have another suggestion?

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Subsites not accesible’ is closed to new replies.