How to solve this error related to a WordPress upgrade on the server? - wordpress

WordPress error on live website:
I can not understand what the error means. This error happened when I updated the WordPress version.
Error like this :
Deprecated: date.php is deprecated since version 5.3.0! Use wp-includes/class-wp-date-query.php instead. in /home/stageberide/public_html/public/blog/wp-includes/functions.php on line 4967
Deprecated: class-oembed.php is deprecated since version 5.3.0! Use wp-includes/class-wp-oembed.php instead. in /home/stageberide/public_html/public/blog/wp-includes/functions.php on line 4967
Fatal error: Uncaught Error: Call to undefined function wp_recovery_mode() in /home/stageberide/public_html/public/blog/wp-includes/load.php:870 Stack trace: #0 /home/stageberide/public_html/public/blog/wp-includes/load.php(754): wp_is_recovery_mode() #1 /home/stageberide/public_html/public/blog/wp-settings.php(303): wp_get_active_and_valid_plugins() #2 /home/stageberide/public_html/public/blog/wp-config.php(89): require_once('/home/stageberi...') #3 /home/stageberide/public_html/public/blog/wp-load.php(37): require_once('/home/stageberi...') #4 /home/stageberide/public_html/public/blog/wp-admin/admin.php(34): require_once('/home/stageberi...') #5 /home/stageberide/public_html/public/blog/wp-admin/index.php(10): require_once('/home/stageberi...') #6 {main} thrown in /home/stageberide/public_html/public/blog/wp-includes/load.php on line 870

first of all, create backup on your hosting provider. then,
Try downloading WordPress again, access your server via SFTP or FTP, or a file manager in your hosting account’s control panel (consult your hosting provider’s documentation for specifics on these), and delete then replace your copies of everything on the server except the wp-config.php file and the /wp-content/ directory with fresh copies from the download. This will effectively replace all of your core files without damaging your content and settings.
Some uploaders tend to be unreliable when overwriting files, so don’t forget to delete the original files before replacing them.

Related

How to fix chmod errors when updating wordpress theme?

I recently upgraded from php 5 to 7.2 and my wp site didnt work, service temporarily unavailable error. So I logged into the backend and WP 5.4 was telling me I needed to check security issues of which I resolved 2 of 3 automatically but 1 could not which is "restrict access to files and folders". So I tried to update the 2017 theme and when I do so I get a bunch of these(although its the same error):
Selected items were updated with errors:
- Unable to update theme 'twentyseventeen_1.7_1_', details: PHP Warning: chmod(): Operation not permitted in /var/www/vhosts/santiapps.com/httpdocs/wordpress_2/wp-admin/includes/class-wp-filesystem-direct.php on line 168
Warning: chmod(): Operation not permitted in /var/www/vhosts/santiapps.com/httpdocs/wordpress_2/wp-admin/includes/class-wp-filesystem-direct.php on line 168
PHP Warning: chmod(): Operation not permitted in /var/www/vhosts/santiapps.com/httpdocs/wordpress_2/wp-admin/includes/class-wp-filesystem-direct.php on line 168
Warning: chmod(): Operation not permitted in /var/www/vhosts/santiapps.com/httpdocs/wordpress_2/wp-admin/includes/class-wp-filesystem-direct.php on line 168...
and near the end it reads:
Warning: The update cannot be installed because we will be unable to copy some files. This is usually due to inconsistent file permissions. "front-page.php, rtl.css, 404.php...
Then in the end it doesnt update of course. A suggestion by the Wordpress Toolkit on plesk is:
Im using filezilla and changing the permissions to those files but I get "operation not permitted".
[SOLVED] (at least for me)
Me too on Cloudways and Digital Ocean.
Just restart the server and error is gone.

How to fix 'Uncaught PHP Exception Twig_Error_Loader: Unable to find template' on Symfony 3.4?

I deployed a symfony 3.4 project from my local machine (Windows 10) to a cloud server (Digital Ocean) based on Ubuntu.
I spent 2 days trying to resolve this (i think) routing problem:
"request.CRITICAL: Uncaught PHP Exception Twig_Error_Loader..."
Locally, on localhost with XAMPP, it works perfect.
The project runs ok on the login (is like a backend user app), with the register ok But when it tries to pass the login, it needs to load the initial dashboard with some includes (like nav_side.html.twig) and the server response is error 500.
How can i fix it?
Thanks a lot for your response...i'm a little bit desperate. :)
I made composer update, i deleted the cache folder, but the error is still there.
request.CRITICAL: Uncaught PHP Exception Twig_Error_Loader: "Unable to
find template "Backe ndBundle:includes:nav_side.html.twig"
(looked into: /var/www/onecup/app/Resources/views,
/var/www/onecup/vendor/s
ymfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form) in
"BackendBundle:Dashboard:index.html.twig" at line 7." at
/var/www/onecup/vendor/twig/twig/lib/Twig/Loader/Filesystem.php line
234 {"exception":"[object] (Twig_Err or_Loader(code: 0):
Unable to find template \"BackendBundle:includes:nav_side.html.twig\"
(looked into: /var/www/ onecup/app/Resources/views,
/var/www/onecup/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form)
in \"BackendBundle:Dashboard:index.html.twig\" at line 7. at
/var/www/onecup/vendor/twig/twig/lib/Twig/Loader/Fil
esystem.php:234)"} []
#Flying was right: examine your code and try to find possible case inconsistences in directory / filenames. e.g. "file" and "File". Windows filesystem is case-insensitive, but Ubuntu filesystem is case-sensitive.
So, i changed the Includes to includes and that's all.
Thanks a lot!! :)

wordpress site error after using virus scanner from Cpanel

I scanned my website virus from cpanel virus scanner and its scanned some viruses is /logs folder and some in /mail/... folders some mails
I deleted those destroy all those mails and quarantined one file from /logs follder after that my site is not accessing
here is the error
Fatal error: Uncaught Error: Call to undefined function ts_theme_favicon() in /home/worldlink/public_html/wp-content/themes/gon/header.php:17 Stack trace: #0 /home/worldlink/public_html/wp-includes/template.php(688): require_once() #1 /home/worldlink/public_html/wp-includes/template.php(647): load_template('/home/worldlink/...', true) #2 /home/worldlink/public_html/wp-includes/general-template.php(41): locate_template(Array, true) #3 /home/worldlink/public_html/wp-content/themes/gon/page.php(3): get_header('') #4 /home/worldlink/public_html/wp-includes/template-loader.php(74): include('/home/worldlink/...') #5 /home/worldlink/public_html/wp-blog-header.php(19): require_once('/home/worldlink/...') #6 /home/worldlink/public_html/index.php(17): require('/home/worldlink/...') #7 {main} thrown in /home/worldlink/public_html/wp-content/themes/gon/header.php on line 17
When you see errors with the WordPress core, such as:
/home/worldlink/public_html/wp-includes/template-loader.php
it's time to reinstall WordPress. It's likely there is malicious code in the core files they was referencing one of the files you deleted, and that's why you're suddenly getting errors.
I've found WordFence to be a brilliant plugin for scanning all the files that make up your website (core, theme and plugins) and identifying exactly which files have been compromised.
In the error you reported, your theme is giving errors as well:
/home/worldlink/public_html/wp-content/themes/gon/header.php
Try switching to another theme and seeing if that resolves the issue.

Suddely files started missing from Wordpress and showing errors

My domain: bharahobe.info
I have installed WordPress in main domain and sydney theme. Everything was okay. Suddenly when I visit my site it shows error messages. Like this:
Warning: require(/home/bharahob/public_html/wp-includes/pomo/mo.php):
failed to open stream: No such file or directory in
/home/bharahob/public_html/wp-settings.php on line 102
Fatal error: require(): Failed opening required
'/home/bharahob/public_html/wp-includes/pomo/mo.php'
(include_path='.:/usr/lib/php:/usr/local/lib/php') in
/home/bharahob/public_html/wp-settings.php on line 102
What should I do now?
If you have access through FTP or SSH, you should log into the server and verify that those files exist. The files may have been deleted by a bot or botched upgrade. The permissions may have changed as well.
If the files are actually missing, you can probably get away with downloading the version of WP you're currently running and replace the missing files.

Symfony production environment throws 500 error: Doctrine\ORM\ORMException 'Unknown Entity namespace alias 'DSBlogBundle'

I'm learning Symfony2, really cool stuff. But I do run into some trouble when I want to try and visit the production environment. I have followed the Symblog Tutorial that is located here: http://tutorial.symblog.co.uk/
I have cleared the cache and I visit http://symfony.dev/ I have running locally. The page remains totally blank and this error is in the log:
Fatal error: Uncaught exception 'Doctrine\ORM\ORMException' with message 'Unknown Entity namespace alias 'DSBlogBundle'.'
in /Applications/MAMP/htdocs/symfony/vendor/doctrine/orm/lib/Doctrine/ORM/ORMException.php:236
Stack trace:
#0 /Applications/MAMP/htdocs/symfony/vendor/doctrine/orm/lib/Doctrine/ORM/Configuration.php(194): Doctrine\ORM\ORMException::unknownEntityNamespace('DSBlogBundle')
#1 /Applications/MAMP/htdocs/symfony/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php(554): Doctrine\ORM\Configuration->getEntityNamespace('DSBlogBundle')
#2 /Applications/MAMP/htdocs/symfony/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php(194): Doctrine\ORM\Mapping\ClassMetadataFactory->getFqcnFromAlias('DSBlogBundle', 'Blog')
#3 /Applications/MAMP/htdocs/symfony/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php(295): Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory->getMetadataFor('DSBlogBundle:Bl...')
#4 /Applications/MAMP/htdocs/symfony/vendor in /Applications/MAMP/htdocs/symfony/vendor/doctrine/orm/lib/Doctrine/ORM/ORMException.php on line 236
What I don't get is that the 'Unknown Entity namespace alias 'DSBlogBundle' is perfectly "known" in the development environment. Does anyone know what I am missing? Any help is much appreciated! Thank you!
Couple possibilities I can think of:
1) If your code functions properly in the development environment, then it could be a cache problem and/or a permissions problem. Make sure your files are readable by the user/process associated with your web server and make sure the prod cache directory is writable by that user so it can generate the necessary files. What I generally do is run the clear cache console command AS that user to avoid unexpected cache problems, like this (on linux):
sudo -u www-user php app/console cache:clear --env=prod
If you're developing on linux, you must be logged in as either root or another user with administrator privileges to run a command as a user other than yourself.
2) You may have configurations defined in the dev environment that don't exist in the prod environment. Double check the files in your app/config folder. My first guess would have been that the DSBlogBundle wasn't correctly defined in app/AppKernel.php but I believe that's environment independent so it couldn't work in dev but not prod.

Resources