I'm trying to upgrade WordPress to the latest 4.2.2. On the screen, I'm seeing:
Downloading update from https://downloads.wordpress.org/release/wordpress-4.2.2-no-content.zip… Unpacking the update… Could not create directory. Installation Failed
And in the php error log, I get
PHP Fatal error: Call to undefined function add_action() in /home/userhome/public_html/wp-content/themes/launchframe/functions.php on line 81, referer: http://example.com/wp-admin/update-core.php?action=do-core-upgrade
What appears to be happening is the theme functions.php file is being included instead of the wp-includes/functions.php. This is new though - previous upgrades have gone fine. I've tried including the "missing" files in my theme's functions.php (i.e.)
require_once('/home/userhome/public_html/wp-includes/plugin.php'); require_once('/home/userhome/public_html/wp-includes/theme.php'); require_once('/home/userhome/public_html/wp-includes/shortcodes.php'); require_once('/home/userhome/public_html/wp-includes/media.php');
But ultimately that failed because more and more files ended up being referenced. I also tried calling wp-load.php from my theme's functions.php file, but that ended up loading my theme again and got "function already defined" errors.