Skip Navigation

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 0 replies, has 0 voices.

Last updated by Lauren 1 week, 2 days ago.

Assisted by: Lauren.

Author Posts
December 3, 2024 at 2:25 pm

alessandroS-40

Background of the issue:
I was trying to update my staging website by installing all updates for Divi, plugins, and WordPress. After updating WordPress from version 6.6.1 to 6.7.1, I encountered PHP warnings. The real paths are overwritten by the string 'l10n.php', causing incorrect paths. Here are the installed WPML plugins with their respective versions: WPML Multilingual CMS 4.6.14, String Translation 3.2.16, Contact Form 7 Multilingual 1.3.2, WPML SEO 2.1.0.1, Media Translation 2.7.5. Although these are warnings, I am concerned they might cause other errors during website management operations.

Symptoms:
PHP warnings appear in the log file indicating 'file_exists(): open_basedir restriction in effect'. The warnings specify that certain files are not within the allowed paths, and this issue seems to have occurred after updating WordPress.

[03-Dec-2024 11:55:34 UTC] PHP Warning: file_exists(): open_basedir restriction in effect. File(/home/stagl10n.phpin.com/public_html/wp-content/themes/Divi/core/languages/it_IT.l10n.php) is not within the allowed path(s): (/home/stage.mydomain.com/public_html/:/home/stage.mydomain.com/tmp/:/tmp/) in /home/stage.mydomain.com/public_html/wp-content/plugins/wpml-string-translation/classes/MO/Hooks/LoadTextDomain.php on line 173
[03-Dec-2024 11:55:35 UTC] PHP Warning: file_exists(): open_basedir restriction in effect. File(/home/stagl10n.phpin.com/public_html/wp-content/plugins/includes/languages/divi-blog-extras-it_IT.l10n.php) is not within the allowed path(s): (/home/stage.mydomain.com/public_html/:/home/stage.mydomain.com/tmp/:/tmp/) in /home/stage.mydomain.com/public_html/wp-content/plugins/wpml-string-translation/classes/MO/Hooks/LoadTextDomain.php on line 173
[03-Dec-2024 11:55:35 UTC] PHP Warning: file_exists(): open_basedir restriction in effect. File(/home/stagl10n.phpin.com/public_html/wp-content/languages/wpml/admin_texts_wpseo_titles-it_IT.l10n.php) is not within the allowed path(s): (/home/stage.mydomain.com/public_html/:/home/stage.mydomain.com/tmp/:/tmp/) in /home/stage.mydomain.com/public_html/wp-content/plugins/wpml-string-translation/classes/MO/Hooks/LoadTextDomain.php on line 173

Questions:
How can the PHP warnings be fixed?
Can these warnings cause other errors during website management operations?

December 3, 2024 at 3:34 pm
December 3, 2024 at 3:38 pm #16472813

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-05:00)

Please let me know if changing the version of PHP resolves the warning messages. Thanks!

December 4, 2024 at 3:18 pm #16477449

alessandroS-40

Hi,
as you suggested I tested the website on a new server with PHP 8.1.31 (debian) and I found the same issue with this version too.

I also verified that on your sandbox, in the php configuration the open_basedir directive is not set and probably for this reason you can't reproduce the issue.
hidden link

Try if setting
open_basedir = /var/www/sites/grey-sampler/
issue occurs also on your sandobx.

December 16, 2024 at 8:51 pm #16518962

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-05:00)

It seems that the issue might be related to the 'open_basedir' restriction on the server, which limits the paths PHP can access, potentially affecting file operations. We recommend contacting your hosting provider to discuss modifying the 'open_basedir' settings or other server configurations that might be causing these errors, and make sure the specific paths in the errors are all allowed.

December 18, 2024 at 8:14 pm #16527508

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-05:00)

I just came across this errata that looks like it may be related to your issue. Can you please try the workaround here and let me know if this resolves it?
https://wpml.org/errata/php-warning-file_exists-open_basedir-restriction-in-effect-warning-possible-with-current-string-translation/