Question

How do I fix " Fatal error: Uncaught Error: Call to undefined function current_time()" Wordpress Droplet

Posted September 7, 2020 2.4k views
WordPress

I am getting this error on my wordpress install. Not sure what went wrong.

Fatal error: Uncaught Error: Call to undefined function current_time() in /var/www/html/wp-includes/functions.php:2416 Stack trace: #0 /var/www/html/wp-includes/functions.php(2275): _wp_upload_dir() #1 /var/www/html/wp-content/plugins/buddypress-group-email-subscription/bp-activity-subscription.php(29): wp_upload_dir() #2 /var/www/html/wp-includes/class-wp-hook.php(287): ass_loader() #3 /var/www/html/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters() #4 /var/www/html/wp-includes/plugin.php(478): WP_Hook->do_action() #5 /var/www/html/wp-content/plugins/buddypress/bp-core/bp-core-dependency.php(33): do_action() #6 /var/www/html/wp-includes/class-wp-hook.php(287): bp_include() #7 /var/www/html/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters() #8 /var/www/html/wp-includes/plugin.php(478): WP_Hook->do_action() #9 /var/www/html/wp-content/plugins/buddypress/bp-core/bp-core-dependency.php(318): do_action() #10 /var/www/html/wp-includes/class-wp-hook.php(287): bp_loaded() #11 /var/www/html/wp-includes/class-w in /var/www/html/wp-includes/functions.php on line 2416
There has been a critical error on your website.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
3 answers

Hi, @webprotime

Could you please let me know if this is a new WordPress installation or not? Have you made any recent changes like core version or plugin update or if you’ve recently installed and activated any new plugins?

I will recommend you to go through your plugins and disabled them for a moment and then activate them one by one and test your website every time you activate a plugin as in this way you can check if the error is caused by a faulty plugin.

Hope that this helps!
Regards,
Alex

Hi @alexdo I’m having the same issue on my Wordpress installation, it’s an old installation and no plugin or core updates have been made to the core. I disabled the plugins and theme through console but I’m getting the same error.

  • Hi, @manuelLobster

    What you can do is to use strace in order to check if there are any hidden errors. You can also check if there any logged PHP errors in the error_log.

    In order to perform the strace diagnostic you can use the following command:

    strace php index.php

    Note that you must be in the WordPress root directory when performing the diagnostic. Also if you’re getting any errors when trying to execute the command you can apply the full path to your PHP binary, e.g:

    strace /usr/bin/php index.php

    When you execute the command you will get a lot of output and what you need to do is to slowly scroll up and check for the last opened file and check for any logged errors. In case there is a PHP error you should see it just before the munmap references in the log.

    Hope that this helps!
    Regards,
    Alex

    • We are also suddenly seeing this error. Our wordpress site has been working without problems for several months now. Nothing has changed recently; the first we knew of an issue was today when some automated software noticed that one of our pages was not accessible. I tried the strace command you gave, @alexdo, but I don’t see any obvious errors before the munmap references - but I’m not really sure what I should be looking for either, to be honest. The only references to ‘error’ in the output seems to be in filename, e.g. an open on …class-wp-error.php. If you have any other tips of how to get this resolved or how to debug it further I’d appreciate them!

      • Hi, @ablock

        I will recommend you to try replacing the WordPress core files with fresh ones in case your website was compromised. You can download the latest available WordPress version and replace the wp-includes and the wp-admin folders within your WordPress root dir. You can rename the old folders to wp-adminOLD and wp-includesOLD and chmod those to 000 for the meantime. You can also replace the files within the WordPress root dir (without replacing the wp-config.php file).

        You can also update all of your administrative passwords and make sure to use a strong randomly generated passwords.

        Hope that this helps!
        Regards,
        Alex

    • Hi, also seeing this error suddenly on one site. We have multiple sites with the same setup and it’s reoccurring on this particular site over and over.

      • It’s a hunch, but I’m wondering if it relates to this vulnerability: https://arstechnica.com/information-technology/2020/09/hackers-are-exploiting-a-critical-flaw-affecting-350000-wordpress-sites/. Not confirmed yet, though… I’m currently looking into if I can verify that somehow, but perhaps this hunch helps put someone else on the right track (or perhaps someone can reassure me that that is not the issue somehow!)

      • Hi, @adminc6c166f42122112ae4e37

        I will recommend you to try replacing the WordPress core files with fresh ones in case your website was compromised. You can download the latest available WordPress version and replace the wp-includes and the wp-admin folders within your WordPress root dir. You can rename the old folders to wp-adminOLD and wp-includesOLD and chmod those to 000 for the meantime. You can also replace the files within the WordPress root dir (without replacing the wp-config.php file).

        You can also update all of your administrative passwords and make sure to use a strong randomly generated passwords.

        Hope that this helps!
        Regards,
        Alex

  • Hi, @manuelLobster

    I will recommend you to try replacing the WordPress core files with fresh ones in case your website was compromised. You can download the latest available WordPress version and replace the wp-includes and the wp-admin folders within your WordPress root dir. You can rename the old folders to wp-adminOLD and wp-includesOLD and chmod those to 000 for the meantime. You can also replace the files within the WordPress root dir (without replacing the wp-config.php file).

    You can also update all of your administrative passwords and make sure to use a strong randomly generated passwords.

    Hope that this helps!
    Regards,
    Alex

My previous answer is awaiting review by a moderator - I suspect because it contained a link to an article on the subject (or maybe all posts are moderated?)… but in the meantime, I am now confident that in our case the site was hacked using a recently discovered Wordpress File Manager plugin vulnerability. Google those terms and you can find plenty of articles about it :-( . I have opened a support ticket with Digital Ocean in relation to this (#3664280) with more details to back up that assertion.

  • Hi, @adminc6c166f42122112ae4e37

    I will recommend you to try replacing the WordPress core files with fresh ones in case your website was compromised. You can download the latest available WordPress version and replace the wp-includes and the wp-admin folders within your WordPress root dir. You can rename the old folders to wp-adminOLD and wp-includesOLD and chmod those to 000 for the meantime. You can also replace the files within the WordPress root dir (without replacing the wp-config.php file).

    You can also update all of your administrative passwords and make sure to use a strong randomly generated passwords.

    Hope that this helps!
    Regards,
    Alex

  • Have you been able to fix the problem. I am having the same issue on two sites running on the same server. I keep restoring them from a backup and they go down after a couple of days (at first) then almost daily.

Submit an Answer