PHP Fatal error: Uncaught Error: Call to undefined function wp_normalize_path()

Trying to resolve certain wordpress php errors after upgrade.

PHP Fatal error:  Uncaught Error: Call to undefined function wp_normalize_path() in (...)\wp-includes\plugin.php:654
Stack trace:
#0 (...)\wp-includes\plugin.php(755): plugin_basename('(...)\\wp...')
#1 (...)\wp-content\plugins\bbpress-genesis-extend\init.php(44): register_activation_hook('(...)\\wp...', Array)
#2 (...)\wp-content\plugins\bbpress-genesis-extend\init.php(89): bbpge_init->__construct()
#3 (...)\wp-settings.php(84): include('(...)\\wp...')
#4 (...)\wp-config.php(205): require_once('(...)\\wp...')
#5 (...)\wp-load.php(37): require_once('(...)\\wp...')
#6 (...)\wp-blog-header.php(13): require_once('(...)\\wp...')
#7 (...)\index.php(17): require((...)\\wp...')
Manoj ChackoAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Manoj ChackoAuthor Commented:
also getting a lot of this
PHP Fatal error:  Uncaught Error: Call to undefined function get_header()


PHP Fatal error:  Allowed memory size of 1073741824 bytes exhausted (tried to allocate 262144 bytes) in (...)\wp-includes\class-wp-hook.php on line 286
[22-May-2018 16:30:28 UTC] PHP Fatal error:  Allowed memory size of 1073741824 bytes exhausted (tried to allocate 262144 bytes) in (...)\wp-includes\load.php on line 679
It's almost certainly a bug in the plugin.

The wp_normalize_path() function is defined in "functions.php", which is included on line 98 from wp-settings.php, but on line 84 of wp-settings.php, it will include the advanced cache code if there are any plugins that enable it.

In this case, it looks like bbpress-genesis-extend is called from within the advanced cache file, and it is initializing itself too early and tries to use the function that hasn't been defined yet.

It also looks like this plug-in hasn't been tested on recent versions of WP, so you might need to find another plugin that does something similar that is being actively maintained, because my guess is that the developer just stopped updating the plugin and doesn't care anymore if it breaks in newer versions of WP.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
The get_header() error is the same root cause - it is being called too early, before it is being defined. Try disabling your bbpress-genesis-extend plugin.

The memory problem also sounds like a bad plugin. Wordpress should never be taking up 1 gig of memory, so you might have a plugin that is caught in an infinite loop or something.
Amazon Web Services

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

Manoj ChackoAuthor Commented:
the get header was on this line
PHP Fatal error:  Uncaught Error: Call to undefined function get_header() in (...)\wp-includes\theme-compat\embed.php:13
Stack trace:
#0 {main}
  thrown in (...)\wp-includes\theme-compat\embed.php on line 13
Manoj ChackoAuthor Commented:
This is another Error I get a lot
All-in-One Event Calendar: ob_get_clean(): failed to delete buffer of zlib output compression (1) @ (...)\wp-content\plugins\all-in-one-event-calendar\lib\global-functions.php:38 #8
All-in-One Event Calendar: ob_get_clean(): failed to discard buffer of zlib output compression (1) @ (...)\wp-content\plugins\all-in-one-event-calendar\lib\global-functions.php:38 #8
David FavorLinux/LXD/WordPress/Hosting SavantCommented:
Looks like you have many problems.

All this is very easy to resolve using command line tools + reviewing your PHP config file(s).

My guess is...

1) Increase your php.ini memory settings, as memory errors can cause a cascade of many other problems.

2) Change themes. It appears you're running a theme which was badly written or more likely, is so old it fails to meet current WordPress coding requirements.

3) Upgrade to latest WordPress (if you haven't).

4) Retest with a light weight theme like GeneratePress (from the WordPress repository).

5) Retest with All-in-One Event Calendar plugin disabled, as this problem looks to be trying to highjack + modify content (common action) except it's doing this incorrectly, producing the ob_get_clean() failures.
My first 2 comments address the issue. Unless anyone else objects, I'll auto-close this with those comments as the accepted answers.

@David - Memory errors don't cascade into other problems. If a memory limit is reached it stops the script in its tracks. I'd suggest never recommending an increase in PHP memory limits until it's been well-established that there is no memory leak. Increasing the memory limits to fix an out-of-memory issue when the process is already taking up 1 gigabyte of memory is usually not a good idea. In fact, a 1 gigabyte memory limit is pretty outrageous for a WP site, since it dramatically decreases the number of possible concurrent visitors AND is pretty slow (it takes a while to load up 1 gigabyte of data, even in memory).

NOTE: I just noticed the OP asked follow-up questions about another plugin, which really should have been covered by my earlier comments about plugins, but since I wasn't specific about it, I'd suggest that your comment be included in the solution.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development

From novice to tech pro — start learning today.