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
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 -
- 19:00 – 22:00 19:00 – 22:00 19:00 – 22:00 19:00 – 22:00 19:00 – 22:00 -

Supporter timezone: Asia/Kathmandu (GMT+05:45)

This topic contains 4 replies, has 2 voices.

Last updated by Subash Chandra Poudel 1 year, 9 months ago.

Assisted by: Subash Chandra Poudel.

Author Posts
August 31, 2023 at 8:25 am #14318271

rikH-2

Hi,

we're building a elearning site in Dutch language that uses WPML for translations. I'm looking into the performance of the website, and using New Relic I found that WPML and especially string translation take 20-25% of rendering time of pages.

Digging deeper I discovered a lot of warnings in the server log, one of which I will paste at the end of this message.

As you can see, it complains about "wp-content/plugins/sitepress-multilingual-cms/locale/wpml-translation-management-nl_NL.mo" not being in the allowed paths. The reason is not that the file or directory aren't accessible, but it's because a relative path is used. The absolute path of the file is "https://cdn.wpml.org/home/anouka/domains/academy.anouka.nl/public_html/wp-content/plugins/sitepress-multilingual-cms/locale/wpml-translation-management-nl_NL.mo" and "/home/anouka/" is within the allowed paths.

When I disable open_basedir the speed of the site is greatly improved, but that's not an option because of security concerns.

Can you help solving this?

Thanks for your time, best wishes,
Rik

[Thu Aug 31 10:10:57.335192 2023] [proxy_fcgi:error] [pid 3750467:tid 140388562405120] [remote 86.81.188.47:50200] AH01071: Got error 'PHP message: PHP Warning: is_readable(): open_basedir restriction in effect. File(wp-content/plugins/sitepress-multilingual-cms/locale/wpml-translation-management-nl_NL.mo) is not within the allowed path(s): (/home/anouka/:/tmp/:/var/tmp/:/opt/alt/php82/usr/share/pear/:/dev/urandom:/usr/local/php82/lib/:/usr/local/php82/lib/:/usr/local/php80/lib/:/usr/local/php81/lib/:/usr/local/lib/php/) in /home/anouka/domains/academy.anouka.nl/public_html/wp-content/plugins/wpml-string-translation/classes/MO/Hooks/LoadMissingMOFiles.php on line 109; PHP message: PHP Warning: is_readable(): open_basedir restriction in effect. File(wp-content/plugins/js_composer/locale/js_composer-nl_NL.mo) is not within the allowed path(s): (/home/anouka/:/tmp/:/var/tmp/:/opt/alt/php82/usr/share/pear/:/', referer: hidden link

September 1, 2023 at 11:50 am #14326321

Subash Chandra Poudel

Hi Rik,

First of all, we recently launched a beta version of WPML String translation that solves performance issues in some cases. Can you please go to wp-admin -> Plugins -> Add New -> Commercial ( tab ) then select "Beta" for "Updates channel" and update WPML plugins to the latest release and see if it helps with this issue?

Now, regarding the open_basedir warning are you sure all folders within /home/anouka/ are in the allowed list? Can you please specifically allow the folder /home/anouka/domains/academy.anouka.nl/public_html/wp-content/plugins/sitepress-multilingual-cms/locale/ and see if it makes any difference?

In case it does not help, will it be possible for you to setup a test/staging copy site in the same server with the same issue replicated where we can further troubleshoot the open_basedir issue?

Regards,
Subash

September 1, 2023 at 1:37 pm #14326919

rikH-2

Hi Subash,

thanks for your mail and suggestions!

I have installed the beta version of wpml and string translation but unfortunately the error still exists.

I have tried updating the open_basedir configuration, but couldn't manage it to use my config. Changes didn's show up in phpinfo. I did however write a small php script to check the readability and writeability of some files that are in the error log. Everything I checked was both readable and writeable.

Here's my sample script
<?php
// $abs_filename = 'https://cdn.wpml.org/home/anouka/domains/academy.anouka.nl/public_html/wp-content/plugins/sitepress-multilingual-cms/locale/sitepress-nl_NL.mo';
$abs_filename = 'https://cdn.wpml.org/home/anouka/domains/academy.anouka.nl/public_html/wp-content/languages/plugins/user-menus-nl_NL.mo';
if (is_readable($abs_filename)) {
echo 'The absolute file is readable<br>';
} else {
echo 'The absolute file is not readable<br>';
}
if (is_writable($abs_filename)) {
echo 'The absolute file is writeable<br>';
} else {
echo 'The absolute file is not writeable<br>';
}
$rel_filename = 'wp-content/plugins/sitepress-multilingual-cms/locale/sitepress-nl_NL.mo';
if (is_readable($rel_filename)) {
echo 'The relative file is readable<br>';
} else {
echo 'The relative file is not readable<br>';
}
//$rel_filename = 'wp-content/plugins/sitepress-multilingual-cms/locale/sitepress-nl_NL.mo';
$rel_filename = 'wp-content/languages/plugins/user-menus-nl_NL.mo';
if (is_writable($rel_filename)) {
echo 'The relative file is writeable<br>';
} else {
echo 'The relative file is not writeable<br>';
}

You can check the output on hidden link This one may be handy as well: hidden link

I had already setup a staging site since I'm doing quite a bit of development on this server at the moment. I've created the following account for you:

[REMOVED BY SUPPORT]

Thank you for looking into this!

Best wishes,
Rik

September 5, 2023 at 6:45 pm #14346913

Subash Chandra Poudel

Hi Rik, thank you for the details.

Note: I have removed the sensitive information you shared in the previous reply for security. Please note you should share sensitive information only when asked for and through a private reply that will be enabled for you as this is a public forum.

I have enabled a private reply for you now, can you please share temporary access (WP-Admin and FTP) to your site now? Preferably to a test site where the problem has been replicated.

I have enabled a private reply for you to share the credentials securely, which means only you and I have access to it.

IMPORTANT: Please take a complete backup of the site first to avoid data loss.

Also, please let me know the exact steps to process to see the Performance and/or the open_basedir warnings on the site once I am logged in.

Regards,
Subash

September 7, 2023 at 1:55 pm #14360325

Subash Chandra Poudel

Thank you for the details.

So there are two parts to the issue: 1. Performance issue and 2. open_basedir error in logs.

For the Performance issue, I did some tests and could not conclude that WPML causes the performance issue. The site in general seems to be unstable in itself as the site load speed ( as per Query Monitor ) is not always the same even when I deactivate all WPML plugins the site sometimes loads in ~7 seconds but sometimes takes up to 20 seconds. The issue is there even when all WPML plugins are deactivated so the case should be coming from somewhere else. Most probably other plugins, themes, code, or the server itself.

Now, regarding the open_basedir issue, I don't see the open_basedir related error anywhere on the site, I even enabled WordPress Debug mode ( https://wpml.org/documentation/support/debugging-wpml/ ) but I don't see or get any open_basedir related errors. Most probably the error you see on the server was one one-off issue that was caused during your tests.

In conclusion, I see the site is unstable performance-wise but I cannot conclude the issue is due to WPML or open_basedir. I recommend you test the issue further and do a conflict test if possible after a backup, or test by deactivating all plugins, activating a default theme then activating them one at a time to see which one starts the performance issues or makes the site unstable. Also, consult with your hosting provider/manager regarding the open_basedir and/or the performance issue.

Looking forward to your updates.

Regards,
Subash

The topic ‘[Closed] Lots of open_basedir warnings with files that should be accesible’ is closed to new replies.