After migration from Linux to Windows server there is on website fatal error in WordPress core. Debug log:
[22-Jul-2022 13:07:54 UTC] PHP Fatal error: Uncaught Error: Class 'WP_Session_Tokens' not found in D:\Sites\subdoms\test\wp-includes\class-wp-user-meta-session-tokens.php:17
Stack trace:
#0 D:\Sites\subdoms\test\wp-settings.php(188): require()
#1 D:\Sites\subdoms\test\wp-config.php(105): require_once('D:\\Sites\\web_98...')
#2 D:\Sites\subdoms\test\wp-load.php(50): require_once('D:\\Sites\\web_98...')
#3 D:\Sites\subdoms\test\wp-blog-header.php(13): require_once('D:\\Sites\\web_98...')
#4 D:\Sites\subdoms\test\index.php(17): require('D:\\Sites\\web_98...')
#5 {main}
thrown in D:\Sites\subdoms\test\wp-includes\class-wp-user-meta-session-tokens.php on line 17
Before migration was active W3 total cache. Could it be related?
I removed W3 total cache, class-wp-user-meta-session-tokens.php and other WordPress files seems correct.
Related
The website randomly went down and I can't figure out how to correct the following error. I have tried toggling all plugins, the server was recently updated to PHP 7.4 from PHP 7.3 but no other website has had this issue.
My Setup:
PHP - PHP 7.4.11 (cli) (built: Oct 8 2020 17:32:43)
uname - Debian 4.19.146-1 (2020-09-17) x86_64 GNU/Linux
MySQL - mysql Ver 15.1 Distrib 10.3.23-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
Error from the website:
Fatal error: Uncaught Error: Call to undefined function wp_cache_add()
in /WEBSITE_PATH/wp-includes/option.php:258 Stack trace: #0
/WEBSITE_PATH/wp-includes/functions.php(1717): wp_load_alloptions() #1
/WEBSITE_PATH/wp-includes/load.php(664): is_blog_installed() #2
/WEBSITE_PATH/wp-settings.php(159): wp_not_installed() #3
/WEBSITE_PATH/wp-config.php(99): require_once('/home/swcsoldie...') #4
/WEBSITE_PATH/wp-load.php(37): require_once('/home/swcsoldie...') #5
/WEBSITE_PATH/wp-blog-header.php(13):
require_once('/home/swcsoldie...') #6 /WEBSITE_PATH/index.php(22):
require('/home/swcsoldie...') #7 {main} thrown in
/WEBSITE_PATH/wp-includes/option.php on line 258
Fatal error: Uncaught Error: Call to undefined function wp_cache_add()
in /WEBSITE_PATH/wp-includes/option.php:258 Stack trace: #0
/WEBSITE_PATH/wp-includes/option.php(116): wp_load_alloptions() #1
/WEBSITE_PATH/wp-includes/l10n.php(69): get_option() #2
/WEBSITE_PATH/wp-includes/l10n.php(137): get_locale() #3
/WEBSITE_PATH/wp-includes/l10n.php(828): determine_locale() #4
/WEBSITE_PATH/wp-includes/class-wp-fatal-error-handler.php(46):
load_default_textdomain() #5 [internal function]:
WP_Fatal_Error_Handler->handle() #6 {main} thrown in
/WEBSITE_PATH/wp-includes/option.php on line 258
Code from Line 258:
wp_cache_add( 'alloptions', $alloptions, 'options' );
An undefined function error in PHP is fatal error, and means you're calling a function that doesn't exist (at least, at the point and scope it's being called at). Most often, I'd wager 9/10 times, this happens while you're developing and you mistype a function name, str_repace instead of str_replace, for instance.
With all of that being said, wp_cache_add() is a WordPress Core function defined in /wp-includes/cache.php, and is being called by a core file: /wp-includes/option.php on line 258.
Since these core files, and core functions are triggering a fatal "undefined function" error, it means your WordPress installation is failing somewhere. It possibly got corrupted during an update of some kind - it's infrequent, but it does happen for any number of reasons.
To fix this: try reinstalling WordPress, as it is absolutely compatible with PHP 7.4.
I have unzipped the installation folder. When going to the install.php to start the installer I get an Fatal error: Uncaught RuntimeException.
I use XAMPP with PHP 7.2 and I go to:
http://localhost/typo3/install.php
I get following message:
Fatal error: Uncaught RuntimeException: Could not create directory "/Applications/XAMPP/xamppfiles/htdocs/typo3temp/var/log/"! in /Applications/XAMPP/xamppfiles/htdocs/typo3_src/typo3/sysext/core/Classes/Utility/GeneralUtility.php:2172 Stack trace: #0 /Applications/XAMPP/xamppfiles/htdocs/typo3_src/typo3/sysext/core/Classes/Utility/GeneralUtility.php(2140): TYPO3\CMS\Core\Utility\GeneralUtility::createDirectoryPath('/Applications/X...') #1 /Applications/XAMPP/xamppfiles/htdocs/typo3_src/typo3/sysext/core/Classes/Log/Writer/FileWriter.php(222): TYPO3\CMS\Core\Utility\GeneralUtility::mkdir_deep('/Applications/X...') #2 /Applications/XAMPP/xamppfiles/htdocs/typo3_src/typo3/sysext/core/Classes/Log/Writer/FileWriter.php(193): TYPO3\CMS\Core\Log\Writer\FileWriter->createLogFile() #3 /Applications/XAMPP/xamppfiles/htdocs/typo3_src/typo3/sysext/core/Classes/Log/Writer/FileWriter.php(123): TYPO3\CMS\Core\Log\Writer\FileWriter->openLogFile() #4 /Applications/XAMPP/xamppfiles/htdocs/typo3_src/typo3/sysext/core/Classes/Log/Writer/Fil in /Applications/XAMPP/xamppfiles/htdocs/typo3_src/typo3/sysext/core/Classes/Utility/GeneralUtility.php on line 2172
Stacktrace in log file:
Stack trace:
#0 /Applications/XAMPP/xamppfiles/htdocs/typo3_src/typo3/sysext/core/Classes/Utility/GeneralUtility.php(2140): TYPO3\CMS\Core\Utility\GeneralUtility::createDirectoryPath('/Applications/X...')
#1 /Applications/XAMPP/xamppfiles/htdocs/typo3_src/typo3/sysext/core/Classes/Log/Writer/FileWriter.php(222): TYPO3\CMS\Core\Utility\GeneralUtility::mkdir_deep('/Applications/X...')
#2 /Applications/XAMPP/xamppfiles/htdocs/typo3_src/typo3/sysext/core/Classes/Log/Writer/FileWriter.php(193): TYPO3\CMS\Core\Log\Writer\FileWriter->createLogFile()
#3 /Applications/XAMPP/xamppfiles/htdocs/typo3_src/typo3/sysext/core/Classes/Log/Writer/FileWriter.php(123): TYPO3\CMS\Core\Log\Writer\FileWriter->openLogFile()
#4 /Applications/XAMPP/xamppfiles/htdocs/typo3_src/typo3/sysext/core/Classes/Log/Writer/Fil in /Applications/XAMPP/xamppfiles/htdocs/typo3_src/typo3/sysext/core/Classes/Utility/GeneralUtility.php on line 2172
:
No more error logs available..
The error means that php cannot write to your xampp htdocs directory, because of security restrictions of the Applications dir.
You should change your xampp configuration like in this tutorial https://pureinfotech.com/install-xampp-windows-10/
Moved the site from one server to another with postgresql database. Db has been connected. Then I used this command:
composer install
While loading the site, yii debugger shows an error
What is more, composer update shows many errors in console:
PHP Fatal error: Uncaught Error: Call to undefined method Composer\Package\RootPackage::getConfig() in /var/www/907-irbis/data/www/site.ru/vendor/fxp/composer-asset-plugin/Config/ConfigBuilder.php:111
Stack trace:
#0 /var/www/907-irbis/data/www/site.ru/vendor/fxp/composer-asset-plugin/Config/ConfigBuilder.php(74): Fxp\Composer\AssetPlugin\Config\ConfigBuilder::getConfigBase(Object(Composer\Composer), Object(Composer\IO\ConsoleIO))
#1 /var/www/907-irbis/data/www/site.ru/vendor/fxp/composer-asset-plugin/FxpAssetPlugin.php(82): Fxp\Composer\AssetPlugin\Config\ConfigBuilder::build(Object(Composer\Composer), Object(Composer\IO\ConsoleIO))
#2 /usr/share/php/Composer/Plugin/PluginManager.php(215): Fxp\Composer\AssetPlugin\FxpAssetPlugin->activate(Object(Composer\Composer), Object(Composer\IO\ConsoleIO))
#3 /usr/share/php/Composer/Plugin/PluginManager.php(188): Composer\Plugin\PluginManager->addPlugin(Object(Fxp\Composer\AssetPlugin\FxpAssetPlugin))
#4 /usr/share/php/Composer/Installer/PluginInstaller.php(62): Composer\Pl in /var/www/907-irbis/data/www/site.ru/vendor/fxp/composer-asset-plugin/Config/ConfigBuilder.php on line 111
Fatal error: Uncaught Error: Call to undefined method Composer\Package\RootPackage::getConfig() in /var/www/907-irbis/data/www/site.ru/vendor/fxp/composer-asset-plugin/Config/ConfigBuilder.php:111
Stack trace:
#0 /var/www/907-irbis/data/www/site.ru/vendor/fxp/composer-asset-plugin/Config/ConfigBuilder.php(74): Fxp\Composer\AssetPlugin\Config\ConfigBuilder::getConfigBase(Object(Composer\Composer), Object(Composer\IO\ConsoleIO))
#1 /var/www/907-irbis/data/www/site.ru/vendor/fxp/composer-asset-plugin/FxpAssetPlugin.php(82): Fxp\Composer\AssetPlugin\Config\ConfigBuilder::build(Object(Composer\Composer), Object(Composer\IO\ConsoleIO))
#2 /usr/share/php/Composer/Plugin/PluginManager.php(215): Fxp\Composer\AssetPlugin\FxpAssetPlugin->activate(Object(Composer\Composer), Object(Composer\IO\ConsoleIO))
#3 /usr/share/php/Composer/Plugin/PluginManager.php(188): Composer\Plugin\PluginManager->addPlugin(Object(Fxp\Composer\AssetPlugin\FxpAssetPlugin))
#4 /usr/share/php/Composer/Installer/PluginInstaller.php(62): Composer\Pl in /var/www/907-irbis/data/www/site.ru/vendor/fxp/composer-asset-plugin/Config/ConfigBuilder.php on line 111
Just migrated a website from local machine to staging server.
Weirdly, the theme isn't loading the functions even though the stack trace looks correct:
[15-Dec-2017 00:22:51 UTC] PHP Fatal error: Uncaught Error: Call to undefined function of_get_option() in /var/www/html/assets/themes/underscore/header.php:37
Stack trace:
#0 /var/www/html/wp-includes/template.php(555): require_once()
#1 /var/www/html/wp-includes/template.php(514): load_template('/var/www/html/a...', true)
#2 /var/www/html/wp-includes/general-template.php(45): locate_template(Array, true)
#3 /var/www/html/assets/themes/underscore/index.php(1): get_header()
#4 /var/www/html/wp-includes/template-loader.php(75): include('/var/www/html/a...')
#5 /var/www/html/wp-blog-header.php(16): require_once('/var/www/html/w...')
#6 /var/www/html/index.php(17): require('/var/www/html/w...')
#7 {main}
thrown in /var/www/html/assets/themes/underscore/header.php on line 37
I am in a hurry so I have tried just copying a copy of the of _get_option function into the file which got rid of the error.
But then up popped another one in it's place.
[15-Dec-2017 00:29:35 UTC] PHP Warning: include_once(../wp-includes\option.php): failed to open stream: No such file or directory in /var/www/html/assets/themes/underscore/header.php on line 33
[15-Dec-2017 00:29:35 UTC] PHP Warning: include_once(): Failed opening '../wp-includes\option.php' for inclusion (include_path='.:/usr/share/php') in /var/www/html/assets/themes/underscore/header.php on line 33
[15-Dec-2017 00:29:35 UTC] PHP Fatal error: Uncaught Error: Call to undefined function WC() in /var/www/html/assets/themes/underscore/header.php:79
Stack trace:
#0 /var/www/html/wp-includes/template.php(555): require_once()
#1 /var/www/html/wp-includes/template.php(514): load_template('/var/www/html/a...', true)
#2 /var/www/html/wp-includes/general-template.php(45): locate_template(Array, true)
#3 /var/www/html/assets/themes/underscore/index.php(1): get_header()
#4 /var/www/html/wp-includes/template-loader.php(75): include('/var/www/html/a...')
#5 /var/www/html/wp-blog-header.php(16): require_once('/var/www/html/w...')
#6 /var/www/html/index.php(17): require('/var/www/html/w...')
#7 {main}
thrown in /var/www/html/assets/themes/underscore/header.php on line 79
Anyone got any clue why this is?
themes/underscore/header.php has an incorrect reference to another file, this looks likely to be a problem /wp-includes\option.php
I am getting following error: using cakephp, aws.
Warning: _cake_core_ cache was unable to write 'cake_dev_en-gb' to
File cache in /var/www/html/myApp/lib/Cake/Cache/Cache.php on line 328
Warning: /var/www/html/myApp/app/tmp/cache/persistent/ is not writable
in /var/www/html/myApp/lib/Cake/Cache/Engine/FileEngine.php on line
385
Fatal error: Uncaught exception 'CacheException' with message 'Cache
engine "_cake_core_" is not properly configured. Ensure required
extensions are installed, and credentials/permissions are correct' in
/var/www/html/myApp/lib/Cake/Cache/Cache.php:186 Stack trace: #0
/var/www/html/myApp/lib/Cake/Cache/Cache.php(151):
Cache::_buildEngine('_cake_core_') #1
/var/www/html/myApp/app/Config/core.php(383):
Cache::config('_cake_core_', Array) #2
/var/www/html/myApp/lib/Cake/Core/Configure.php(72):
include('/var/www/html/i...') #3
/var/www/html/myApp/lib/Cake/bootstrap.php(431):
Configure::bootstrap(true) #4
/var/www/html/myApp/app/webroot/index.php(95):
include('/var/www/html/i...') #5 {main} thrown in
/var/www/html/myApp/lib/Cake/Cache/Cache.php on line 186
NOTE : tmp folders have full permission(777), yet getting the same error, please advise?
I have gone through
https://groups.google.com/forum/#!topic/cake-php/gKFJf6mK6qk
also.
Please check with server configuration, Firewall should be disable on the server to access 777 folder by anonymous users.