Skip Navigation

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

Problem:
The client was experiencing a 500 Internal Server Error when trying to switch languages on their website.

Solution:
First, we recommended a workaround involving adding code to the

functions.php

file, which the client confirmed was effective. We clarified that 'temporary' means the solution will work as long as the code remains in place.

Next, we suggested the client perform a conflict test by:
1. Deactivating all plugins except WPML to see if the issue persists, indicating a possible plugin conflict.
2. Switching the theme to a default WordPress theme like Twenty Twenty to check for a theme-related issue.

We also provided a link to a known errata that could be related to the issue:

If these steps do not resolve the issue or if the solution provided does not seem relevant, we encourage the client to open a new support ticket for further assistance. For additional support, please visit our WPML support forum.

100% 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.

Tagged: 

This topic contains 4 replies, has 2 voices.

Last updated by Bruno Kos 1 year, 8 months ago.

Assisted by: Bruno Kos.

Author Posts
October 18, 2023 at 9:04 am #14600531

binayahR-2

I am trying to: Switch Language

Link to a page where the issue can be seen: Anywhere

I expected to see:

Instead, I got: Most of the time it gives 500 Internal server error

October 18, 2023 at 1:54 pm #14604851

Bruno Kos
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

Thank you for contacting WPML support!

Before we investigate this issue further, could you make sure your server conforms to our minimum requirements?
https://wpml.org/home/minimum-requirements/

Based on provided debug information, I can see the following - WP Memory Limit: 40M.

Could you set WP Memory limit to at least 256MB?

https://wordpress.org/support/article/editing-wp-config-php/#increasing-memory-allocated-to-php

So just add this into wp-config.php file:

define('WP_MEMORY_LIMIT', '256M');

before this line:

/* That's all, stop editing! Happy publishing. */

If unsure on how to set this, you can consult your host/server admin to do this. After you increase this value, you can confirm it by checking on WPML -> Support by finding the “Memory limit” value.

Regards,
Bruno Kos

October 18, 2023 at 1:54 pm #14604853

Bruno Kos
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+02:00)

If this doesn't help, can you also try this workaround?
https://wpml.org/errata/htaccess-is-rewritten-with-language-folder/

October 19, 2023 at 7:51 am #14611473

binayahR-2

Hi, yes, I tried both options you provide, but I observed that the first one doesn't work for me, but the second one is working (I added the mentioned code to the functions.php file). But I read that this is a temporary hack, and I want to fix this issue on a permanent basis. So we need your guidelines to fix this issue.
Please Guide

October 19, 2023 at 9:11 am #14612997

Bruno Kos
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+02:00)

Temporary here means that it will work for as long as you don't remove that code.

However, can you please check if this issue appears when:

- only WPML plugins are activated, as it will tell us if there is an interaction issue with other plugin
- theme is set to a WordPress default like Twenty Twenty as it will tell us if there is an interaction issue with your theme

Let us know if you were able to find a culprit that causes this as most often is it some plugin.

October 30, 2023 at 7:35 am #14688529

binayahR-2

Hi yes my issue was resolved and will contact you again if required.