This thread is resolved. Here is a description of the problem and solution.
Problem: After moving to a new server and activating the WPML plugin, you are experiencing PHP warnings related to open_basedir restrictions on every page load. This issue started after the server migration, despite using WPML String Translation 3.2.18. Solution: We recommend clearing your logs and cache to ensure that no old server paths are being cached erroneously. It's also important to double-check the logs after performing these steps. If the problem persists, it might be related to specific server settings or configurations that were changed during the server migration. For detailed guidance, please refer to our documentation on this issue: open_basedir restriction issue.
If this solution does not resolve your issue, or if it seems outdated or irrelevant to your case, we 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. Additionally, you can open a new support ticket for further assistance at WPML support forum.
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:
We moved to a new server, activated the WPML plugin, and added language switchers to our site. The issue can be seen at hidden link (in logs only).
Symptoms:
PHP Warning: file_exists(): open_basedir restriction in effect. File(WP Endpoints-en_US.mo) is not within the allowed path(s) in /home/wp/disk/wordpress/wp-content/plugins/wpml-string-translation/classes/MO/Hooks/LoadTranslationFile.php on line 81. I expected to see no warnings, but instead, I got a warning on every page load.
Questions:
How can I resolve the PHP warning related to open_basedir restriction?
Why am I seeing warnings after moving to a new server and activating WPML?
Let me know what you see in the debug.log after enabling debug mode. But before, please try running the option "Show custom MO Files Pre-generation dialog box" in WPML → Support → Troubleshooting.
Thank you. I followed your instructions and these are the entries in the debug.log:
[01-Feb-2025 09:50:14 UTC] PHP Warning: file_exists(): open_basedir restriction in effect. File(WP Endpoints-de_DE.mo) is not within the allowed path(s): [...] in /home/wp/disk/wordpress/wp-content/plugins/wpml-string-translation/classes/MO/Hooks/LoadTranslationFile.php on line 81
[01-Feb-2025 09:50:14 UTC] PHP Warning: file_exists(): open_basedir restriction in effect. File(WP Endpoints-de_DE.l10n.php) is not within the allowed path(s): [...] in /home/wp/disk/wordpress/wp-content/plugins/wpml-string-translation/classes/MO/Hooks/LoadTranslationFile.php on line 84
[01-Feb-2025 09:50:14 UTC] PHP Warning: realpath(): open_basedir restriction in effect. File(/) is not within the allowed path(s): [...] in /home/wp/disk/wordpress/wp-includes/l10n/class-wp-translation-controller.php on line 106
[01-Feb-2025 09:50:14 UTC] PHP Warning: file_exists(): open_basedir restriction in effect. File(WordPress-de_DE.mo) is not within the allowed path(s): [...] in /home/wp/disk/wordpress/wp-content/plugins/wpml-string-translation/classes/MO/Hooks/LoadTranslationFile.php on line 81
[01-Feb-2025 09:50:14 UTC] PHP Warning: file_exists(): open_basedir restriction in effect. File(WordPress-de_DE.l10n.php) is not within the allowed path(s): [...] in /home/wp/disk/wordpress/wp-content/plugins/wpml-string-translation/classes/MO/Hooks/LoadTranslationFile.php on line 84
[01-Feb-2025 09:50:14 UTC] PHP Warning: realpath(): open_basedir restriction in effect. File(/) is not within the allowed path(s): [...] in /home/wp/disk/wordpress/wp-includes/l10n/class-wp-translation-controller.php on line 106
I need to request temporary access (wp-admin and FTP) to your site—preferably to a test site where the problem has been replicated if possible—in order to be of better help. When you log in to leave your next reply, you will find the needed fields below the comment area. The information you will enter is private, meaning only you and I can see and access it.