Re-Direct Loops & Internal Server 500 Error

I'm getting sporadic errors with my multisite (has domain mapping on it with WPMU domain mapping plugin). Sometimes Re-Direct Loops, sometimes Internal Server 500 Error. Sometimes it works perfectly. Any clues?

Notes
I host with Heart Internet who do not allow wildcard subdomains.

  • Adam Czajczyk
    • Support Gorilla

    Hi Elektraman

    I hope you're well today and thank you for your question!

    The fact that wild-card is not allowed shouldn't cause this. It's certainly much easier (and recommended) to use wild-card for sub-domain based Multisite but it's not a requirement. I understand that this is a sub-domain setup, right?

    It gets a bit more complex if the redirect loop issues are intermittent rather than "constant" so were you able to spot some sort of "pattern" regarding this? Or maybe there are only certain "places"/actions that sometimes result in redirect loop? Anything that you can think of could be helpful...

    As for 500 Internal Server Error. If it happens "sometimes" also (not all the time in specific cases), there's a good chance that it's related to server resources: the site might be, under some circumstances, consume too much server memory or hitting other limits (like I/O limits, webserver or db connections/queries etc) and as a result that breaks scripts execution causing error. The error is not an issue itself but rather a consequence of either server configuration not powerful enough to handle the site or some "under the hood" issues with site configuration.

    That said, would you please let me know about those redirects and also enable support access to the site so I could take a closer look at the setup? To let me do this, please go to the "Network Admin -> WPMU DEV -> Support" page, click on "Grant support access" button there and let me know here once it's done.

    Best regards,
    Adam

  • Elektraman
    • Design Lord, Child of Thor

    Finally got back to this.

    So, I disabled all plugins, which allowed login, switched the theme to twentyseventeen and then enabled the first plugin (Beaver Builder). No problem there, so I went to enable the second plugin, no matter which plugin I selected the site would crash immediately with a "500 Internal Server Error".

    So i enabled the debugger and repeated the above exercise. The debugger error is:

    [16-Dec-2018 16:21:00 UTC] PHP Fatal error: Out of memory (allocated 139091968) (tried to allocate 843776
    bytes) in /home/sites/ontax.co.uk/public_html/wp-content/plugins/bb-plugin/classes/class-fl-builder.php on line
    2176

    Hosting company have capped PHP at 512MB so I have set my memory up as follows:

    PHP INI
    upload_max_filesize = 256M
    post_max_size = 256M
    memory_limit = 512M
    file_uploads = On
    max_execution_time = 300
    max_input_time = 1000

    ======

    .HTACCESS
    php_value upload_max_filesize 256M
    php_value post_max_size 256M
    php_value post_max_filesize 256M
    php_value memory_limit 512M
    php_value max_execution_time 300
    php_value max_input_time 1000

    ========
    WP-CONFIG
    define(‘WP_MEMORY_LIMIT’, ‘256M’);
    define(‘WP_MAX_MEMORY_LIMIT’, ‘512M’);

    Any issues in what I have done?

    Any other suggestions?

  • Predrag Dubajic
    • Support

    Hi Elektraman,

    Is the message still the same after you have increased your resources?
    It's possible that the changes you've made didn't affect the master value.
    To check this, go to your WP root folder and create a file named info.php, and inside that file paste this code:
    <?php phpinfo(); ?>

    Save the file and after that visit youdomain.com/info.php in your browser.
    You will see your PHP information and you can see that there are two columns in there Local and Master values, if Master values are lower than Local then your changes will not actually increase your available resources and you will need to ask your hosting provider to increase those for you.

    Let us know how it goes.

    Best regards,
    Predrag

  • Elektraman
    • Design Lord, Child of Thor

    I've checked the php.info file and it says

    Memory Limit - 512M Local and 512M Master

    (As 512M is what the host caps it at, i'm assuming there is no benefit in increasing it.)

    If I try to enable any plugins at all I get the "Internal Server Error" message.

    Although setup as Multisite, this installation only runs 1 website and its a modest one at that. I surely cant be using the full 512M just enabling say the "Appointments+" plugin by WPMU?

  • Predrag Dubajic
    • Support

    Hi Elektraman,

    512MB should be enough and A+ shouldn't cause the limit to be reached.
    You mentioned that this happens with any plugin you activate, are you referring to WPMU DEV plugins or any plugin that you activate?

    Have you discussed with your host about the errors shown and if they can see some more information from the logs on their end?

    Update: New Error message appears now (when updating plugins): cURL error 77: Problem with the SSL CA cert (path? access rights?)

    Which PHP version do you have on your site, if you have 5.x can you ask your host to update to 7.x and see if that error is gone after that?
    PHP 7, and later, have significant improvements in both security and performance compared to 5.x so if you're not running newer version I would strongly suggest doing that as it's quite possible that it will fix your other error as well.

    Best regards,
    Predrag

  • Elektraman
    • Design Lord, Child of Thor

    Update: This is interesting! I logged this issue again with the hosting company who then replied back that they had put my PHP limit up from 512MB to 1024MB...(Yet they had previously told me that 512MB was the max I could get with them on shared hosting....mmmmm...think they told me a fib there :slight_smile: ).

    So all errors have now disappeared and plugins can be updated and enabled without any issues.

  • Elektraman
    • Design Lord, Child of Thor

    So, a new questions for the techies:

    Given that my host has upped me to 1024MB, these are my current settings, should I alter anything in php.ini or .htaccess to reflect this?:

    PHP INI
    upload_max_filesize = 256M
    post_max_size = 256M
    memory_limit = 512M
    file_uploads = On
    max_execution_time = 300
    max_input_time = 1000

    ======

    .HTACCESS
    php_value upload_max_filesize 256M
    php_value post_max_size 256M
    php_value post_max_filesize 256M
    php_value memory_limit 512M
    php_value max_execution_time 300
    php_value max_input_time 1000

    ========
    WP-CONFIG
    define(‘WP_MEMORY_LIMIT’, ‘1024M’);
    define(‘WP_MAX_MEMORY_LIMIT’, ‘1024M’);

  • Predrag Dubajic
    • Support

    Hi Elektraman,

    There's no need to change anything else, those defines in all those files are usually not even needed, they depend on your hosting provider and their server setup.
    For example, some servers will allow you to change the value directly via wp-config.php, others will block that and require php.ini changes and so on.
    Basically, if your site is running fine now and info.php file states that the master value is 1024M you're good to go.

    Best regards,
    Predrag

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.