This thread is resolved. Here is a description of the problem and solution.

PHP error when updated to 4.2 and above

 Undefined index: url in  plugins/sitepress-multilingual-cms/vendor/otgs/ui/loader.php on line 97

Solution from the client, wp_content directory was renamed to app, use relapath to define WP_CONTENT_DIR

define('WP_CONTENT_DIR', realpath(__DIR__.'/../public_html/app'));[/php]

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.

This topic contains 7 replies, has 3 voices.

Last updated by sergioA-3 10 months, 2 weeks ago.

Assigned support staff: Raja Mohammed.

Author Posts
July 16, 2019 at 10:17 am #4218917


When I activate any version from 4.2 onwards I get a PHP error related to...
plugins/sitepress-multilingual-cms/vendor/otgs/ui/loader.php on line 97

We have been using versions below 4.2 for specific reasons on a site and need to update all plugins so when we added the latest we got this error. We then stepped back through all the previous releases and found that 4.2 onwards causes this issue.

v4.1.4 is fine.

The error appears on local and online development versions of the website.

I have seen some support comments about perms but this can't be the issue as the process for moving files is the same and only the v4.2 releases and up are causing the error.

Is there anything in the 4.2 release that could be causing this issue?

TwentyNineteen theme activated with only the sitepress-multilingual-cms plugin activated.


July 16, 2019 at 12:02 pm #4219975

Raja Mohammed

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi Michael,

I will help you with your issue.

WPML version 4.2.0 had some issue with the installer files which has been fixed in the later releases. Please update WPML to the latest version

Automatic updates might not work with the installer issue. please refer to the solution in the ticket below regarding the Alternative steps to update WPML to the latest version

I hope this helps you better, Let me know if you need further assistance.

kind regards

July 16, 2019 at 12:24 pm #4220117


Hi, thanks for the reply.
As mentioned none of the versions from 4.2 up work and I get the same error.
I am adding the plugin manually into the plugins folder.
I have added in the latest version and the same error appears.

Please advise.

July 16, 2019 at 12:58 pm #4220213

Raja Mohammed

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)


Could you please paste the full error from the error log, I hope you have enabled debug log already if not, It would be good if you can provide me with the WordPress debug.log (not WPML debug information).

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

define('WP_DEBUG', true);
define( 'WP_DEBUG_LOG', true );

In this case, the errors will be saved to a debug.log log file inside the /wp-content/ directory.

If you can paste your debug.log to and provide me that link it would be great! (This is the cleanest way because sometimes the logs are long and create a complete mess in the discussion).

Kind regards

July 17, 2019 at 8:31 am #4227479


Hi Raja,

I just want to add that we don't use 'wp-content' and change this to 'app'.
We also use a PHP Dot ENV file to manage the environment but that shouldn't really make a difference.


July 17, 2019 at 8:55 am #4227887


Hi, Ok we have resolved the issue.

In our wp-config we change the path of the wp-content dir to..

define('WP_CONTENT_DIR', __DIR__.'/../public_html/app'); 

In loader.php there is a call to this path assuming it's not been altered.

We have changed this in our code to..

define('WP_CONTENT_DIR', realpath(__DIR__.'/../public_html/app'));

I would suggest using realpath too just to make sure you are using an absolute path.


July 17, 2019 at 3:28 pm #4231765

Raja Mohammed

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Glad your issue is resolved, 🙂

I am adding your solution to the resolved summary so that other users can benefit.

Kind regards

August 20, 2019 at 1:41 pm #4424121


I'm having the same issue and although I do have a different WP_CONTENT_DIR set it's already using "realpath".