500 error after upgrading from 5.0 to 5.4 and adding empty functions.php

I’ve managed to print the error message by adding the following to the functions.php: function exception_handler($exception) { echo “Uncaught exception: ” , $exception->getMessage(), “\n”; } set_exception_handler(‘exception_handler’); For some reason logs did not include the error details before. The error is call to undefined function is_blog_installed() which I have no idea why’s that. 😀

Notice: Use of undefined constant REQUEST_URI – assumed ‘REQUEST_URI’ in ….functions.php on line 73

*Without quotes PHP interprets the REQUEST_URI as a constant** but corrects your typo error if there is no such constant and interprets it as string. When error_reporting includes E_NOTICE, you would probably get an error such as: Notice: Use of undefined constant REQUEST_URI – assumed ‘REQUEST_URI’ in <file path> on line <line number> But if … Read more

Trying to display ads on only a third of posts in a loop. Keep getting Error 500?

echo “<img src=\”” . bloginfo(‘template_url’); . “/img/sample-ad-side.png\” alt=\”Sample Advertisement\”>”; You added a semicolon, what comes after that semicolon is a new statement. . “img/ etc is not valid PHP, so it errors out. Also bloginfo does not return its value, it prints it, so you need to change that to get_bloginfo. I would suggest you … Read more

Why would running an admin check throw a 500 error? I’m calling is_super_admin();

From your pastebin: if (!function_exists(‘wp_get_current_user’)) { include_once( ABSPATH . ‘wp-admin/includes/pluggable.php’ ); } if ( is_super_admin() ) { add_action( ‘admin_init’, ‘myplugin_register’); add_action( ‘admin_menu’, ‘myplugin_menu’ ); } There is no file at wp-admin/includes/pluggable.php. pluggable.php is at wp-includes/pluggable.php, but I see no reason you should have to intentionally include that file. It load front and back end.