Home›Support›English Support›[Resolved] PHP Fatal error: Uncaught Error: Class 'Twig_Template' not found
[Resolved] PHP Fatal error: Uncaught Error: Class 'Twig_Template' not found
This thread is resolved. Here is a description of the problem and solution.
Problem: The client was experiencing issues with caching and had questions about migrating to a new server with WPML, including updating the domain and preserving WPML settings.
Solution: 1. We suggested that the issue might be related to caching settings or a caching plugin, not WPML directly. If WPML is uninstalled and reinstalled, settings remain since they are saved in the database. A WPML reset would remove all settings.
2. To disable Language Switcher caching, navigate to WPML > Support > Troubleshooting and use the provided option.
3. After migrating to a new domain, remove the old key and generate a new key for the production domain at WPML.org > Account > Sites. Then, register WPML with the new key in the website backend.
4. To migrate the site, we recommended using the Duplicator plugin, which handles URL replacement and preserves WPML settings. Documentation for Duplicator can be found at https://snapcreek.com/duplicator/docs/.
5. Clearing WPML cache is only necessary when caching issues are suspected. There is no cron job for this; it must be done manually in WPML > Support > Troubleshooting.
6. We are not aware of any unique setup required for WPML when configuring the LSCACHE plugin.
7. If the client needs to update the pre-prod environment to remove a notice, they should open a new ticket closer to the migration date.
If this solution does not apply to your situation, or if it seems outdated, we recommend opening a new support ticket. We also highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins.
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
Tell us what you are trying to do?- thisi is the full error i got in my log file " PHP Fatal error: Uncaught Error: Class 'Twig_Template' not found in /home/notaryne/public_html/wp-content/uploads/cache/wpml/twig/2f/2f6fc3c68b0fba15a208cd7923a27eda9ae10cbd85f2386bc6aef6b03bc18075.php:4
Sorry for the delay and thank you very much for your patience. There has been a pretty full queue in the past days so that is why it took a while to get back to you but things should move fast from now on.
It seems that this issue is coming from a caching folder which is weird and it might not be realated to WPML directly.
So I think this is somehow related to the caching settings or to a caching plugin.
I can't make the ticket private, only you can when you create it but I can remove from it any information that you want me to. Also, please note that any URLs that are shared in the tickets are visible only to you and us (the supporters).
I hope that you will find this information helpful. 🙂
1. so although the path for the error is //"wp-content/uploads/cache/wpml/ " you think that this is related to Chace and not wpml ?
2. just to make it clear according to the log i sent you did you see anything problematic with the WPML ?
3. in addןtion few question related to new server that i plan to migrate to :
a.the server is with diff URL since we are moving to lite speed machine :
b.at the moment the WPML note that the new domain is a dev at every page ".This site is registered on wpml.org as a development site. Switch to a production site key to remove this banner "
when i will do the transition and will update the prod domain on this machine - do i need to update something in the WPML/key or it will remove the message of the dev env since the new domain will be recognized automatically ?
b . if i want to export the current setup of WPML and save it to a file /or other option to make sure that my test and stage env will have the same setup how i do it ?
1. That should be just caching - so I would recommend that you go to WPML > Support > Troubleshooting > and there's an option where you can disable the Language Switcher caching
2. Things look pretty good in the debug information that you attached. There's a new WPML plugin version for the main WPML plugins and some add-ons and you should be able to find those if you go to Plugins > Add new > Commercial > check for updates > and then update them. It is recommended that you first create a full website backup before doing that.
3. After you migrate your site to the new domain, you will just need to go to WPML.org > Account > Sites (https://wpml.org/account/sites) > remove the old key (dev key) that you were using and generate a new key for the domain (production key).
After that, go back to the newly migrated website backend > Plugins > Add new > Commercial and register WPML with the new key (you might need to click "Unregister" first so that you UNregister WPML from the old key).
Sometimes, even after following the steps I mentioned above, you might still see that notice due to existing caching on the site or on the server/CDN (if used).
To clear the server cache, you would need to reach the hosting support.
To clear the site cache, please make sure that you clear/remove it from any existing caching plugin that you might have installed on the site.
Here is a small tutorial on how to use Duplicator: hidden link
This plugin should easily take care of the URL-replacing process and should also keep all the WPML settings, as those are saved in the database.
5. All the URLs shared here in our conversation should be visible only to you and me. Am I maybe missing a URL that you maybe shared and that is visible somewhere if you visit this page from an incognito window (or without being logged into your WPML.org account)?
hi
first thanks for your answer
second some questions :
1. "disable the Language Switcher caching " - if i will do it what is the impact on my website -and what is the main goal of this option?
2. when I clear the cache in my website via the main cache plugin - is it clear also the wpml cache ? if not how often do i need to "clear the cache in WPML " ? Can it be control via a cron job ?
3.do i need to make any unique setup to cache in WPML when i config the LSCACHE plugin ?
4.in order to avoid the issue of "Sometimes, even after following the steps I mentioned above, you might still see that notice due to existing caching " - can you update my pre-prod env that is using a different domain (lawyers-israel.net) a week before the migration to make sure that this note will be removed (since we are moving to new code ver+new server and i migrate only the DB - and i want to make sure that i will not get user error about the note since we generate cert that should be without any additional note !
1. Language switcher caching tries (like any caching) to speed up your website and not have to load the same information over and over again. Here we are talking about language switcher settings + styling
2. Clearing the WPML caching is recommended only when there's an issue where you suspect it would/could be the caching that's making things not respond to your actions/updates. There's no cron job for this, it can be manually handled from inside WPML > Support > Troubleshooting.
3. I am not aware of anything like that
4. When the time comes, please open a new ticket asking for that specific thing and we will see what can be done at that exact moment and situation.