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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 -
- - - - - - -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 5 replies, has 0 voices.

Last updated by Waqas Bin Hasan 5 months, 1 week ago.

Assisted by: Waqas Bin Hasan.

Author Posts
November 26, 2024 at 10:33 pm #16447076

paoloB-21

Background of the issue:
I am trying to address an issue with string translation files under WordPress 6.7.1 and PHP 8.3. I noticed lines like this in the error log: [Tue Nov 26 22:16:16.906964 2024] [proxy_fcgi:error] [pid 917641:tid 140596165412608] [client 4.227.36.112:0] AH01071: Got error 'PHP message: PHP Warning: is_dir(): open_basedir restriction in effect. File(/plugins) is not within the allowed path(s): (/home/admin/.composer:/home/admin/web/vud-design.com/public_html:/home/admin/web/vud-design.com/private:/home/admin/web/vud-design.com/public_shtml:/home/admin/tmp:/tmp:/var/www/html:/bin:/usr/bin:/usr/local/bin:/usr/share:/opt) in /home/admin/web/vud-design.com/public_html/wp-content/plugins/wpml-string-translation/classes/MO/LoadedMODictionary.php on line 103'. It seems that the function maybeAdjustPathToStandardLanguageFolders() is not looking for the right folder because WP_LANG_DIR is not defined. There is also a check which is probably outdated: // The WP RC version is `6.7-RC1` which is an improper format for comparison (we'd need `6.7.0-RC1`). if ( WordPress::versionCompare('>', '6.6.999') ) { $mofile = $this->maybeAdjustPathToStandardLanguageFolders($mofile, $domain); } The log entry disappears if I raise that WP version number.

Symptoms:
I am seeing a PHP warning related to open_basedir restriction and an issue with the function maybeAdjustPathToStandardLanguageFolders() not finding the correct folder due to WP_LANG_DIR not being defined.

Questions:
How can I resolve the open_basedir restriction warning?
Is there a way to correctly define WP_LANG_DIR to avoid this issue?

November 27, 2024 at 7:56 am #16447747

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting the support.

Looks like the issue may not be related to WPML but with some restriction in your server. I'll recommend checking with your hosting/service provider for more details.

Additionally, I'll recommend to try the following as well, to ensure if issue is being caused by another plugin or theme:

1) Take a full backup of your site and database before proceeding. It is highly advised to try these on a dev or staging site first, so your live site isn't compromised.
2) Deactivate all plugins except WPML and String Translation.
3) Switch to a standard theme like 2024 or 2021.
4) Check for the issue if it still happens.
5) Then start activating plugins one by one while keep checking for the issue. This way you 'll be able to pinpoint a conflict when & where it starts creating the problem.
6) If after activating all plugins you see that it still works fine, then switch to your theme and see if that's causing it.

Please let me know your findings and I'll try my best to help you further on the matter.

Regards.

November 27, 2024 at 8:38 am #16447959

paoloB-21

Hey, thank you for the standard answer i already read in this forum.

As i said.. in latest stable wpml string translation there is a check on wp version if WP version is higher than 6.6.999 that is apparently calling a function where WP_LANG_DIR constant (not defined in my environment) is used.

if ( WordPress::versionCompare( '>', '6.6.999' ) ) {

File is LoadedMODictionary.php line 63.

This is calling a method that is not considering the fact that WP_LANG_DIR is not defined so results empty and then the code looks for path /plugins which is from system root so not accessible by the php code, generating the warning.

So IT LOOKS LIKE a WPML string translation related problem. And i fixed it by editing that version number. Please fix in next release (the actual beta have no changes related to that, i checked).

thanks

Schermata 2024-11-27 alle 09.37.13.png
November 27, 2024 at 12:04 pm #16448924

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the updates. I am working again on this and 'll get back to you as soon as I've an update.

November 28, 2024 at 8:09 am #16453292

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for your patience and cooperation. I'm checking with my team and 'll get back to you accordingly.

November 28, 2024 at 1:08 pm #16455214

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for your patience and cooperation.

I'm trying to reproduce the issue in a sandbox site but without any luck. Can you please tell me any steps or changes you did recently and which can be helpful in reproducing the issue? So I can then retry and escalate the issue accordingly.

The topic ‘[Closed] Warning opening string translation files under wp 6.7.1 / php 8.3’ is closed to new replies.