mySQL Error while migrating WordPress Website locally - php

I am trying to migrate a live WordPress site to my localhost environment. And I believe that the PHP version on current hosting server is higher than my localhost environment version, which is causing some issue while migrating. As I don't know much about SQL code as well as how to interpret the error log, can you guide me on what I should be doing to rectify the error?
Followed is the error message I am getting:
Fatal error: Uncaught Error: Call to undefined function mysql_escape_string() in C:\xampp\htdocs\shag\wp-content\themes\twentyseventeen\functions.php:60
Stack trace:
#0 C:\xampp\htdocs\shag\wp-settings.php(425): include()
#1 C:\xampp\htdocs\shag\wp-config.php(89): require_once('C:\\xampp\\htdocs...')
#2 C:\xampp\htdocs\shag\wp-load.php(37): require_once('C:\\xampp\\htdocs...')
#3 C:\xampp\htdocs\shag\wp-blog-header.php(13): require_once('C:\\xampp\\htdocs...')
#4 C:\xampp\htdocs\shag\index.php(17): require('C:\\xampp\\htdocs...')
#5 {main} thrown in C:\xampp\htdocs\shag\wp-content\themes\twentyseventeen\functions.php on line 60

define('WP_USE_EXT_MYSQL', true);
Would you please define above code in your wp-config.php? And check it. I think it's helpful for you.

Related

Wordpress wp-admin fatal error

I have just switched my website's hosting and it is giving me error in opening the wordpress admin panel page. Can any body help me out. Thankyou
Fatal error: Uncaught Error: Call to undefined function eregi() in
/home/atifchat/public_html/pakistanivoicechat.com/wp-content/plugins/google-bot-bling/google-bot-bling.php:59
Stack trace: #0
/home/atifchat/public_html/pakistanivoicechat.com/wp-includes/class-wp-hook.php(298):
thisismyurl_google_bot_bling_init_code('') #1
/home/atifchat/public_html/pakistanivoicechat.com/wp-includes/class-wp-hook.php(323):
WP_Hook->apply_filters(NULL, Array) #2
/home/atifchat/public_html/pakistanivoicechat.com/wp-includes/plugin.php(453):
WP_Hook->do_action(Array) #3
/home/atifchat/public_html/pakistanivoicechat.com/wp-settings.php(448):
do_action('init') #4
/home/atifchat/public_html/pakistanivoicechat.com/wp-config.php(104):
require_once('/home/atifchat/...') #5
/home/atifchat/public_html/pakistanivoicechat.com/wp-load.php(37):
require_once('/home/atifchat/...') #6
/home/atifchat/public_html/pakistanivoicechat.com/wp-admin/admin.php(31):
require_once('/home/atifchat/...') #7
/home/atifchat/public_html/pakistanivoicechat.com/wp-admin/in in
/home/atifchat/public_html/pakistanivoicechat.com/wp-content/plugins/google-bot-bling/google-bot-bling.php
on line 59
What hosting did you switch from as well as what hosting did you switch it to? A lot of hosts for WordPress will give you support for this kind of thing especially if you just switched to their services so I would probably call support and give them the URL so that they can see the error and it is likely that they will give you some help. If they don't, try this article: http://www.wpbeginner.com/plugins/how-to-deactivate-all-plugins-when-not-able-to-access-wp-admin/
I remember migrating a site and having to FTP in to rename the plugins folder to plugins.hold or something and then I could login then I went back and renamed it again. But just to be safe I would follow the article and not my words.
The eregi() function, actually, the entire ereg_* family of functions was removed entirely in PHP 7.x. According to your error log, you have a voice chat plugin still using those functions.
Stack trace: #0 /home/atifchat/public_html/pakistanivoicechat.com/wp-includes/class-wp-hook.php
Suggestion: Contact plugin developer and ask them to update.

How to share cakephp 3.0 while using git

I recently installed git for sharing cakephp 3.0 code but after pushing and pulling the browser seems blank then I edit .gitignore file and remove all commands excluding /tem/* because I didn't worry about security right now and then I shared my code and got this error:
Fatal error: Class 'Psr\Log\AbstractLogger' not found in /var/www/html/project/bmw12/vendor/cakephp/cakephp/src/Log/Engine/BaseLog.php on line 24
Fatal error: Uncaught RuntimeException: Could not load class Cake\Log\Engine\FileLog in /var/www/html/project/bmw12/vendor/cakephp/cakephp/src/Log/LogEngineRegistry.php:57 Stack trace: #0
/var/www/html/project/bmw12/vendor/cakephp/cakephp/src/Core/ObjectRegistry.php(91): Cake\Log\LogEngineRegistry->_throwMissingClassError('Cake\\Log\\Engine...', NULL) #1
/var/www/html/project/bmw12/vendor/cakephp/cakephp/src/Log/Log.php(198): Cake\Core\ObjectRegistry->load('Cake\\Log\\Engine...', Array) #2
/var/www/html/project/bmw12/vendor/cakephp/cakephp/src/Log/Log.php(180): Cake\Log\Log::_loadConfig() #3
/var/www/html/project/bmw12/vendor/cakephp/cakephp/src/Log/Log.php(360): Cake\Log\Log::_init() #4
/var/www/html/project/bmw12/vendor/cakephp/cakephp/src/Error/BaseErrorHandler.php(284): Cake\Log\Log::write(3, 'Fatal Error (1)...') #5
/var/www/html/project/bmw12/vendor/cakephp/cakephp/src/Error/BaseErrorHandler.php(216): Cake\Error\BaseErrorHandler->_logError(3, Array) #6
/var/www/html/project/bmw12/vendor/cakephp/cakephp/src/Error/Bas in /var/www/html/project/bmw12/vendor/cakephp/cakephp/src/Log/LogEngineRegistry.php on line 57
I m posting answer for my question, actually its a permission issue in Linux and therefore it doesn't allow to share all the file while using push command in git but while using it doesn't show any error but it doesn't work properly on other end.

How do I stop the "Class log cannot be found" error from occurring in laravel?

I just moved my website to a separate server in an attempt to make sure that when I push the site to the production server everything transitions smoothly. Unfortunately, the site appears blank when I visit the link unless I add something like "echo 'hello';" to the index.php page, nothing is being logged in the laravel storage files (even though the permissions are recursively set to 777), and I get this error:
nickstaging#ubuntuStaging:/var/www/html/almost_acceptable$ php artisan config:cache
PHP Fatal error: Uncaught ReflectionException: Class log does not exist in /var
/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php:741
Stack trace:
#0 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php(741): ReflectionClass->__construct('log')
#1 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php(631): Illuminate\Container\Container->build('log', Array)
#2 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(674): Illuminate\Container\Container->make('log', Array)
#3 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php(842): Illuminate\Foundation\Application->make('log')
#4 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php(805): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter))
#5 /var/www/html/almost_acceptable/vendor/laravel/framework/src/I in /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 741
PHP Fatal error: Uncaught ReflectionException: Class log does not exist in /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php:741
Stack trace:
#0 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php(741): ReflectionClass->__construct('log')
#1 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php(631): Illuminate\Container\Container->build('log', Array)
#2 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(674): Illuminate\Container\Container->make('log', Array)
#3 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php(842): Illuminate\Foundation\Application->make('log')
#4 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php(805): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter))
#5 /var/www/html/almost_acceptable/vendor/laravel/framework/src/I in /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 741
I cannot, for the life of me, figure out why it's occurring. It is recorded in the apache log file on the server. The site still runs correctly on my local homestead vm that I have running for general testing, and I tried reuploading all of the files to the server but nothing has worked.
If anyone has any idea why this is occurring, that would be great and I would very much appreciate it! Thanks in advance!
Edit
Installing php-mysql did not fix the problem and there was no difference in the error afterwards.
The most common problem is either you have spaces in your .env file or a wrong value in one of your config files.
More info here:
https://laracasts.com/discuss/channels/general-discussion/class-log-does-not-exist

Silverstripe: SS_DAG_CyclicException. DAG has cyclic requirements

I have just upgraded a couple of sites from an earlier release of SS3 to the 3.0 stable build (CMS and Sapphire). Now, when I try to dev/build I am getting the following error:
PHP Fatal error: Uncaught exception 'SS_DAG_CyclicException' with message 'DAG has cyclic requirements' in /Users/fraser/Documents/Work/HallPass/sapphire/core/DAG.php:73
Stack trace:
#0 /Users/fraser/Documents/Work/HallPass/sapphire/core/manifest/ConfigManifest.php(272): SS_DAG->sort()
#1 /Users/fraser/Documents/Work/HallPass/sapphire/core/manifest/ConfigManifest.php(144): SS_ConfigManifest->sortYamlFragments()
#2 /Users/fraser/Documents/Work/HallPass/sapphire/core/manifest/ConfigManifest.php(75): SS_ConfigManifest->regenerate(false)
#3 /Users/fraser/Documents/Work/HallPass/sapphire/core/Core.php(275): SS_ConfigManifest->__construct('/Users/fraser/D...', false, false)
#4 /Users/fraser/Documents/Work/HallPass/sapphire/main.php(62): require_once('/Users/fraser/D...')
#5 {main}
thrown in /Users/fraser/Documents/Work/HallPass/sapphire/core/DAG.php on line 73
Everything else works fine however, it's just when I do anything in /dev. I have made some changes and need to regenerate the manifest on these sites.
I have also tried a clean install of SS and am getting the same issue.
Any ideas?
This was a bug in the CMS and Sapphire code. I raised the issue on open.silverstripe.org and it has since been corrected. #7817 on open.silverstripe.org

WordPress regularly produces errors for cron.php, class-wp-hook.php and update.php

For a customer I set up a website in WordPress. The site got hacked and infected with malicious code, so I've re-uploaded all WordPress files and the files for the theme, changed all passwords, installed a security plugin and run several virus scans to remove every line of code, that was suspicious. The site worked normally after doing this, but now I get the following error:
Warning: Cannot call assert() with string argument dynamically in /mnt/web107/d1/74/58360774/htdocs/wp-includes/cron.php on line 1 Warning: call_user_func_array() expects parameter 1 to be a valid callback,
function 'wp_cron' not found or invalid function name in /mnt/web107/d1/74/58360774/htdocs/wp-includes/class-wp-hook.php on line 286
Fatal error: Uncaught Error: Call to undefined function wp_next_scheduled() in /mnt/web107/d1/74/58360774/htdocs/wp-includes/update.php:710 Stack trace: #0 /mnt/web107/d1/74/58360774/htdocs/wp-includes/class-wp-hook.php(286): wp_schedule_update_checks('')
#1 /mnt/web107/d1/74/58360774/htdocs/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array)
#2 /mnt/web107/d1/74/58360774/htdocs/wp-includes/plugin.php(453): WP_Hook->do_action(Array)
#3 /mnt/web107/d1/74/58360774/htdocs/wp-settings.php(450): do_action('init')
#4 /mnt/web107/d1/74/58360774/htdocs/wp-config.php(126): require_once('/mnt/web107/d1/...')
#5 /mnt/web107/d1/74/58360774/htdocs/wp-load.php(37): require_once('/mnt/web107/d1/...')
#6 /mnt/web107/d1/74/58360774/htdocs/wp-blog-header.php(13): require_once('/mnt/web107/d1/...')
#7 /mnt/web107/d1/74/58360774/htdocs/index.php(22): require('/mnt/web107/d1/...')
#8 {main} thrown in /mnt/web107/d1/74/58360774/htdocs/wp-includes/update.php on line 710
The strange thing is, when the errors appear, I only need to re-upload all the WordPress core files and the website works properly for a few weeks again, but then the errors reappear.
Can someone explain me what causes these errors and how to fix them? I googled the errors but couldn't find a fix.
Check your server's cron tasks, it must be something there that tries to execute something, and that's whats causing the error.
Sorry for not being more specific but every hosting company has his own panel.
Regards,
Daniel

Categories