Skip Navigation

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.

Tagged: 

This topic contains 6 replies, has 0 voices.

Last updated by Andrey 3 days ago.

Assisted by: Andrey.

Author Posts
January 30, 2025 at 7:58 pm #16653338

Rico Heinrich

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?

January 30, 2025 at 10:54 pm #16653694

Andrey
Supporter

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+02:00)

Thank you for contacting WPML support.

The issue should be resolved with WPML String Translation 3.2.18. Have you tried to clear logs, cache, and double-check the logs?

https://wpml.org/errata/php-warning-file_exists-open_basedir-restriction-in-effect-warning-possible-with-current-string-translation/

January 31, 2025 at 7:26 am #16654018

Rico Heinrich

Thank you Andrey, this is an interesting clue.

However, we have been using WPML String Translation 3.2.18 for weeks now and this error only started to occur after moving to a new server yesterday.

Which logs do you want me to clear? I cleared the WP Rocket cache completely and double checked the logs again.

I'll attach a screenshot of the latest log entries.

I suspect WPML might somehow still have cached the absolute filepaths of the old server somewhere.

Bildschirmfoto 2025-01-31 um 08.25.56.png
January 31, 2025 at 11:03 pm #16657432

Andrey
Supporter

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+02:00)

Thank you for your feedback.

You are probably checking your server logs. Try activating debugging in WordPress to see if it reflects the same information.

To enable it, open your wp-config.php file and look for define(‘WP_DEBUG’, false);. Change it to:

define('WP_DEBUG', true);

To enable the error logging to a file on the server, you need to add yet one more similar line:

define( 'WP_DEBUG_LOG', true );

The errors will be saved to a debug.log log file inside the /wp-content/directory.

https://wpml.org/documentation/support/debugging-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.

February 1, 2025 at 9:58 am #16658122

Rico Heinrich

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 replaced the path with [...])

February 3, 2025 at 4:46 pm #16663810

Andrey
Supporter

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+02:00)

Thank you for your feedback.

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.

February 4, 2025 at 8:29 am #16665215

Rico Heinrich

I copied the site to a test site but I am not able to replicate the error there.

Actually it occurs less often on our live site now (only 3 times yesterday).

So I think the ticket can be closed and I'll watch it going forward.

Thanks, Andrey.

February 4, 2025 at 2:25 pm #16667322

Andrey
Supporter

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+02:00)

Thank you for the update. I hope it won't cause any more issues. Have a nice week.