• I am in urgent need of assistance as this has been going on for a week now and the web host nor myself are unable to identify what the problem is. The site needs updates made which are impossible while this error is occurring.

    For a week a client site has been getting the following errors:
    **********************************************************************
    Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator at [email protected] to inform them of the time this error occurred, and the actions you performed just before this error.

    More information about this error may be available in the server error log.

    Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
    **********************************************************************
    It only seems to occur on the WP backend however now we are having it intermittently occur on the front end also. It is not related to any specific area of the dashboard. One minute I click Users and it loads, next 10 seconds I go elsewhere and try to go back and the error shows up. Have to use refresh 3 or 4 times to get the page to load or use Back and try again till it eventually loads.

    The hosting company has cPanel. The cPanel error logs are showing HEAPS of the “cannot allocate memory” errors such as:
    **********************************************************************
    [Tue Jun 11 23:37:53.509198 2019] [:error] [pid 3404287] (12)Cannot allocate memory: [client 157.55.39.153:12269] couldn’t create child process: /opt/suphp/sbin/suphp for /home/xxx/public_html/index.php

    **********************************************************************
    Some of the client IP’s listed in the errors are myself but others I have no idea.

    Initially, the web host identified a cron job which was running every 5 minutes and said that was the cause of the Internal Server Error. I deleted the cron job through cPanel as I have no idea when or how it got there (I didn’t create it and no one else has access). Didn’t fix the error.

    Then the host spent a good 24+ hours not sure why the error was still occurring. Next they tell me that the memory allocation issue indicates the website is using more resources than usual. They tell me that a faulty or outdated plugin could be the cause.
    I had already followed this course of troubleshooting before contacting them but just to be safe, I deactivate all plugins one by one – still the error continues.

    I switch back to Twenty Nineteen theme to see if the theme is causing the issue – still the error continues. I roll back to WordPress 5.1 – still the error continues. I had already tried recreating a new .htaccess file – again that didn’t help.

    I have been into cPanel and chosen “Select PHP Version” and then chose “Switch to PHP Options”. memory_limit has already been set to 512M which I assume the web host has done during their troubleshooting.

    I have just now uploaded a new copy of wp-admin and wp-includes via FTP – again still getting the error message.

    I have searched and cannot find any other information about what could be causing this error.. Is anyone able to provide suggestions or assist with this?

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

Viewing 15 replies - 1 through 15 (of 18 total)
  • Moderator t-p

    (@t-p)

    Internal server errors (error 500) are often caused by plugin or theme function conflicts, so if you have access to your admin panel, try deactivating all plugins. If you don’t have access to your admin panel, try manually resetting your plugins (no Dashboard access required). If that resolves the issue, reactivate each one individually until you find the cause.

    If that does not resolve the issue, try switching to the default theme for your version of WordPress to rule-out a theme-specific issue. If you don’t have access to your admin panel, access your server via SFTP or FTP, or a file manager in your hosting account’s control panel, navigate to /wp-content/themes/ and rename the directory of your currently active theme. This will force the default theme to activate and hopefully rule-out a theme-specific issue.

    If that does not resolve the issue, it’s possible that a .htaccess rule could be the source of the problem. To check for this, access your server via SFTP or FTP, or a file manager in your hosting account’s control panel, and rename the .htaccess file. If you can’t find a .htaccess file, make sure that you have set your SFTP or FTP client to view invisible files.

    If you weren’t able to resolve the issue by either resetting your plugins and theme or renaming your .htaccess file, we may be able to help, but we’ll need a more detailed error message.

    Internal server errors are usually described in more detail in the server error log. If you have access to your server error log, generate the error again, note the date and time, then immediately check your server error log for any errors that occurred during that time period. If you don’t have access to your server error log, ask your hosting provider to look for you.

    Also see https://www.ads-software.com/support/article/common-wordpress-errors/#internal-server-error

    Thread Starter beltanconsultancy

    (@thetraininglady)

    @t-p as stated in my original message, I have already done all of that. htaccess recreated. plugins deactivated. default theme activated. nothing has helped. I used the www.ads-software.com article you referenced as a guide also but again had already tried the recommendations listed in that article.

    I have pasted a copy of the error log in my original message.
    Here are a few more of the error messages:
    ************************************
    [Wed Jun 12 00:08:02.948140 2019] [:error] [pid 3427599] (12)Cannot allocate memory: [client 27.121.68.10:43998] couldn’t create child process: /opt/suphp/sbin/suphp for /home/xxx/public_html/index.php, referer: https://www.iwb.net.au/wp-cron.php?doing_wp_cron=1560262082.9178550243377685546875
    [Wed Jun 12 00:08:02.946532 2019] [:error] [pid 3427599] (12)Cannot allocate memory: [client 27.121.68.10:43998] couldn’t create child process: /opt/suphp/sbin/suphp for /home/xxx/public_html/wp-cron.php, referer: https://www.iwb.net.au/wp-cron.php?doing_wp_cron=1560262082.9178550243377685546875
    [Wed Jun 12 00:08:02.103532 2019] [:error] [pid 3426278] (12)Cannot allocate memory: [client 61.69.249.102:53541] couldn’t create child process: /opt/suphp/sbin/suphp for /home/xxx/public_html/wp-admin/users.php, referer: https://www.iwb.net.au/wp-admin/themes.php
    [Wed Jun 12 00:07:48.009196 2019] [:error] [pid 3401445] (12)Cannot allocate memory: [client 46.229.168.148:27990] couldn’t create child process: /opt/suphp/sbin/suphp for /home/xxx/public_html/index.php
    ************************************

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Can you clarify, did you deactivate all plugins and then switch to the Twenty Nineteen theme with all plugins deactivated?

    I was having similar issues the past couple of days and contacted my hosting company. They diagnosed the problem this way:

    “The error message above would explain the intermittent issues as it would occur when the shared memory limit is hit. I found that the sites where using php 7.1 which had op cache enabled. This would be the cause of the errors as op cache is very resource intensive and should not be used on your current VPS. I have gone ahead and removed op cache from the server to correct that issue, you should be all set.”

    Thread Starter beltanconsultancy

    (@thetraininglady)

    @anevins – Yes I deactivated all plugins, switched to Twenty Nineteen theme and all plugins are still deactivated.

    @dsprpete – I just checked in cpanel > PHP options. It is set to PHP version 7.0. the opcache option is not enabled.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Do you have any more logs further back in time before the memory errors?

    Thread Starter beltanconsultancy

    (@thetraininglady)

    @anevins unfortunately no. This has been going on for a week now and the error logs in cPanel only show the last 300 errors which only go back as far as yesterday.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    At this point I’m wondering if there is a plugin you can install that generates more comprehensive error logs.

    Thread Starter beltanconsultancy

    (@thetraininglady)

    @anevins I have no idea. I’m at a complete loss. It actually seems like the error is happening much more now with Twenty Nineteen active and NO plugins activated than what it was at the start of this drama. Before I only had to refresh 2 or 3 times and the page would load. Now I’m having to refresh a dozen times to get the page to load – any page.

    Should I enable debug mode? I’ve never used it before.

    Thread Starter beltanconsultancy

    (@thetraininglady)

    @anevins I enabled debug mode.
    Only errors it logged was:
    [11-Jun-2019 15:11:19 UTC] PHP Notice: Constant WP_MEMORY_LIMIT already defined in /home/xxx/public_html/wp-config.php on line 92
    [11-Jun-2019 15:11:20 UTC] PHP Notice: Constant WP_MEMORY_LIMIT already defined in /home/xxx/public_html/wp-config.php on line 92
    [11-Jun-2019 15:11:22 UTC] PHP Notice: Constant WP_MEMORY_LIMIT already defined in /home/xxx/public_html/wp-config.php on line 92
    [11-Jun-2019 15:11:23 UTC] PHP Notice: Constant WP_MEMORY_LIMIT already defined in /home/xxx/public_html/wp-config.php on line 92

    I went into the wp-config.php file and found the memory limit code and removed it. Uploaded new copy without debug and without memory limit code. But hasn’t helped. I pretty much cannot get the site to load now. At least before I could load it and navigate a bit with the intermittent errors appearing.

    Moderator t-p

    (@t-p)

    Have you discussed this issue with your hosting provider as suggested by dsprpete above?

    Thread Starter beltanconsultancy

    (@thetraininglady)

    @t-p Yep sure have. They tell me its an issue with the site. They told me to deactivate plugins etc etc which I’ve already done. Not really being any help at all. I’m at the stage, 2:26am here that I’m going to do a fresh install and hope to the powers that be i can restore the site from backup. Site was using Updraft plus but for some weird reason it hasn’t put all 5 separate backup files into remote storage, only 2 for each date. I have DB & others for 26 May, plugins & uploads from 28 May and no theme backup except for 3 days ago which would have had the error issue.

    The quick fix is often a server upgrade to buy enough horsepower to ‘power through this problem’.

    I can’t even get into the site to look at it but I’m wondering if you have a bit of malware running there or someone abusing your site or ‘slurping’ some of your content.

    One of the items you mentioned is running PHP 7.0… try throttling up to a higher PHP version like 7.3 if you can else take that back to 5.6 for a bit and see what happens. I think the earlier 7.X versions had a few issues.

    Server logs can sometimes miss rotations and wind up very large to where the next error takes forever to add to the log… often that ‘write’ doesn’t work either and causes another error which starts an endless cycle. That also can be caused by ‘not enough horsepower’.

    Can you get into the CPanel and optimize that database? Probably not the problem but possible.

    Sometimes it’s a neighbor on your host who is clobbering everybody else’s performance but this sort of acts like your host is crashing trying to run your website. I was able to see the CPanel answer so the server is running okay. Makes me think WordPress or PHP issues.

    I imagine you are using some server resources to handle email… anything odd happening with email like a huge influx of spam?

    I’d like to have seen this site on CloudFlare just for their better DNS but you sure don’t want to be running their proxy with 500 errors coming off the server.

    If there’s no easy upgrade path then consider split hosting where you leave the database where it is and move the rest of the site to another server. You’ll need to tell the host to let the other host in the database via the remote SQL tool in your cPanel.

    Coming full circle again… more horsepower.

    Dion

    (@diondesigns)

    SuPHP is an ancient/obsolete PHP handler that is well-known for causing server issues. It also requires the use of mod_cgid, which is a known memory pig. However, the SuPHP/mod_cgid combination is the easiest way to have PHP run as the user that owns the web-facing filesystem, so it’s sometimes used by hosting companies that don’t know any better. Personal opinion, but any hosting company that still uses SuPHP should be avoided.

    Ask your hosting company to change your PHP handler from SuPHP to a FastCGI handler. PHP-FPM is the best option, but mod_fcgid would also work. If they are unwilling (or unable) to do so, then start looking for a new hosting company.

    To the person whose hosting company said to remove OPcache: if the shared memory used by OPcache is causing problems on a VPS, it means the hosting company has too many VPSes on the server (commonly called “oversold”). You should ask them to move your VPS to a less-congested server, and if that doesn’t help, start looking for a new hosting provider.

    Thanks for the heads up @diondesigns.

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘SOS!! Internal Server Error 500’ is closed to new replies.