[Resolved] I have a problem with errors in the debug.log.
This thread is resolved. Here is a description of the problem and solution.
Problem: You are experiencing high CPU usage due to PHP warnings related to 'file_exists()' and 'realpath()' caused by open_basedir restrictions. Solution: If you're encountering these issues, we recommend checking if the REST API is enabled on your site, as it is essential for several WPML features. You can learn more about WPML's REST API dependencies here: https://wpml.org/documentation/support/rest-api-dependencies/ Please follow these steps: 1. Temporarily disable all non-WPML plugins. 2. Ensure that the REST API is enabled. 3. Test again with only WPML plugins active. Always ensure to back up your database before making any changes.
If this solution does not resolve your issue or seems irrelevant due to being outdated or not applicable 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. If further assistance is needed, please open a new support ticket at WPML support forum.
0% of people find this useful.
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:
I am trying to resolve errors in the debug.log that are exhausting my CPU resources on the website. The issue can be seen on the page: hidden link.
Symptoms:
I am encountering PHP warnings related to 'file_exists()' and 'realpath()' due to open_basedir restrictions. These errors are causing high CPU usage.
Questions:
How can I resolve the open_basedir restriction errors?
What steps can I take to reduce CPU usage caused by these errors?
I’ve reviewed the link you provided, but I didn’t notice any warnings on the page.
Could you please provide more details about why you believe this issue is related to WPML? If possible, share the exact warning message here in the support forum so we can better understand and assist you.
[08-Jul-2025 14:34:57 UTC] PHP Warning: file_exists(): open_basedir restriction in effect. File(WP Endpoints-pl_PL.mo) is not within the allowed path(s): (/home/hcwqbgpzyu/domains/bmhorse.com/public_html:/tmp:/var/tmp:/opt/alt/php81/usr/share/pear/:/opt/alt/php72/usr/share/pear/:/opt/alt/php73/usr/share/pear/:/opt/alt/php53/usr/share/pear/:/opt/alt/php83/usr/share/pear/:/opt/alt/php82/usr/share/pear/:/opt/alt/php71/usr/share/pear/:/opt/alt/php70/usr/share/pear/:/opt/alt/php56/usr/share/pear/:/opt/alt/php74/usr/share/pear/:/opt/alt/php54/usr/share/pear/:/opt/alt/php55/usr/share/pear/:/opt/alt/php80/usr/share/pear/:/opt/alt/php84/usr/share/pear/:/dev/urandom:/var/www/html/waf/:/usr/share/GeoIP/:/usr/local/directadmin/plugins/waf/data/hcwqbgpzyu) in /home/hcwqbgpzyu/domains/bmhorse.com/public_html/wp-content/plugins/wpml-string-translation/classes/MO/Hooks/LoadTranslationFile.php on line 82
[08-Jul-2025 14:34:57 UTC] PHP Warning: file_exists(): open_basedir restriction in effect. File(WP Endpoints-pl_PL.l10n.php) is not within the allowed path(s): (/home/hcwqbgpzyu/domains/bmhorse.com/public_html:/tmp:/var/tmp:/opt/alt/php81/usr/share/pear/:/opt/alt/php72/usr/share/pear/:/opt/alt/php73/usr/share/pear/:/opt/alt/php53/usr/share/pear/:/opt/alt/php83/usr/share/pear/:/opt/alt/php82/usr/share/pear/:/opt/alt/php71/usr/share/pear/:/opt/alt/php70/usr/share/pear/:/opt/alt/php56/usr/share/pear/:/opt/alt/php74/usr/share/pear/:/opt/alt/php54/usr/share/pear/:/opt/alt/php55/usr/share/pear/:/opt/alt/php80/usr/share/pear/:/opt/alt/php84/usr/share/pear/:/dev/urandom:/var/www/html/waf/:/usr/share/GeoIP/:/usr/local/directadmin/plugins/waf/data/hcwqbgpzyu) in /home/hcwqbgpzyu/domains/bmhorse.com/public_html/wp-content/plugins/wpml-string-translation/classes/MO/Hooks/LoadTranslationFile.php on line 85
[08-Jul-2025 14:34:57 UTC] PHP Warning: realpath(): open_basedir restriction in effect. File(/usr/local/bin) is not within the allowed path(s): (/home/hcwqbgpzyu/domains/bmhorse.com/public_html:/tmp:/var/tmp:/opt/alt/php81/usr/share/pear/:/opt/alt/php72/usr/share/pear/:/opt/alt/php73/usr/share/pear/:/opt/alt/php53/usr/share/pear/:/opt/alt/php83/usr/share/pear/:/opt/alt/php82/usr/share/pear/:/opt/alt/php71/usr/share/pear/:/opt/alt/php70/usr/share/pear/:/opt/alt/php56/usr/share/pear/:/opt/alt/php74/usr/share/pear/:/opt/alt/php54/usr/share/pear/:/opt/alt/php55/usr/share/pear/:/opt/alt/php80/usr/share/pear/:/opt/alt/php84/usr/share/pear/:/dev/urandom:/var/www/html/waf/:/usr/share/GeoIP/:/usr/local/directadmin/plugins/waf/data/hcwqbgpzyu) in /home/hcwqbgpzyu/domains/bmhorse.com/public_html/wp-includes/l10n/class-wp-translation-controller.php on line 106
I have String Translation 3.3.3,
Everything has been cleaned multiple times. I'll disable and re-enable the plugin, wait until tomorrow to see if it worked, and let you know.
Based on the debug information, it appears that the REST API might not be enabled on your site. I also couldn’t access it directly. I noticed that the Disable WP REST API plugin is active in your installation — please review this setting, as it could be blocking essential functionality.
WPML relies on the REST API for several features. For example:
wpml/st/v1 – This endpoint is used to import and generate MO files, and to save String Translation settings. Disabling the REST API or the String Translation plugin may prevent these features from functioning correctly. https://wpml.org/documentation/support/rest-api-dependencies/
The REST API being disabled may be contributing to the issue you’re experiencing.
If the problem persists, please try the following:
1. Temporarily disable all non-WPML plugins.
2. Ensure that the REST API is enabled.
3. Test this again with only WPML plugins active.
Before making any changes, please ensure that you back up your database first.
I uninstalled the Legacy REST API and disabled the REST API. I also deactivated and reactivated the WPML plugins, cleared the cache — but nothing worked :/
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.
Please include the exact steps to reproduce the issue.