[Resolved] Website under error after migrating from Server A > Server B
This thread is resolved. Here is a description of the problem and solution.
Problem: After migrating a website from one server to another, the layout is damaged, and a PHP fatal error related to the WPML plugin occurs. The error message indicates an issue with
DOMDocument::loadHTML()
being called with an empty argument. Solution: 1. Manually upload fresh copies of the WPML plugins from your account at https://wpml.org/account/downloads/. 2. Temporarily disable all plugins except for the WPML plugin to check if the issue still occurs. 3. If the problem persists, provide temporary access (wp-admin and FTP) to a staging or test site where the problem can be replicated. Include exact steps to replicate the issue for more efficient investigation.
If this solution does not resolve your issue or seems outdated, we 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. If necessary, please open a new support ticket at WPML support forum for further assistance.
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.
Background of the issue:
I migrated my website from Server A to Server B. I am trying to load my page, but the layout is damaged. Inside the logs, I get an error related to the WPML plugin.
Symptoms:
PHP Fatal error: Uncaught ValueError: DOMDocument::loadHTML(): Argument #1 ($source) must not be empty in /var/www/html/wp-content/plugins/wpml-string-translation/StringTranslation/Infrastructure/StringHtml/Repository/HtmlStringsRepository.php:31
Questions:
Why is my website layout damaged after migration?
How can I fix the PHP fatal error related to DOMDocument::loadHTML()?
Could you please provide more details on how you migrated your website?
Based on your description, here are some possible causes of the issue:
• Missing or corrupted data: The string data that WPML expects might be missing from the database or have become corrupted during migration.
• Encoding issues: Incorrect character encoding could prevent the DOMDocument class from interpreting the string as valid HTML.
Could you also check and share the collation settings of your database tables?
I recommend re-migrating your site using a migration plugin such as All-in-One WP Migration or Duplicator. These tools ensure an exact copy of your site (including the database and all fields) is properly transferred to the new server.
Does the same issue occur if you temporarily disable all plugins except WPML plugin?
If the issue persists, I’ll need to request temporary access (wp-admin and FTP) to your site—preferably to a staging or test site where the problem can be replicated.
When you log in to leave your next reply, you’ll find the required fields below the comment area. The information you enter is private, meaning only you and I can see and access it.
Please also include the exact steps to replicate the issue so I can investigate it more efficiently.