Skip to content Skip to sidebar

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 8 replies, has 3 voices.

Last updated by Nigel 1 year, 11 months ago.

Assisted by: Nigel.

Author Posts
July 25, 2023 at 12:21 pm #14096271

celineM-6

the issue is on staging environment of Sifawy
I am trying to: set the Language URL format to "Different languages in directories"

Link to a page where the issue can be seen: hidden link

I expected to see: the Arabic version of the website

Instead, I got: HTTP Error 500

But when I set the Language URL format to "Language name added as a parameter" it works fine

sifawy-ar.PNG
July 25, 2023 at 12:32 pm #14096371

Mihai Apetrei
WPML Supporter since 03/2018

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hi there.

Before this ticket gets assigned to one of my colleagues, I will try to help.

Usually, the 500 errors (Internal Server Errors) are related to the server configuration or server limitations being reached.

You can check our documentation to see if you meet all the WPML minimum requirements here: https://wpml.org/home/minimum-requirements/

Also, please take a look here:
https://wpml.org/faq/500-error

You can also activate WordPress debug to find out more about what is actually happening when you receive that 500 error:
https://wpml.org/documentation/support/debugging-wpml/

I hope that you will find this information helpful.

Please let us know how things go.

Mihai Apetrei

July 26, 2023 at 10:13 am #14102257

celineM-6

Hi There,
I checked all the links above and still not working

July 26, 2023 at 11:16 am #14102947

Nigel
WPML Supporter since 02/2016

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

Hello, let me take over here.

When there is a 500 error it means that a fatal error occurred on the server. We need to see details of the error to try and understand why it happened.

If you edited your wp-config.php file as described in https://wpml.org/documentation/support/debugging-wpml/ then when you try again to change to languages in directories and it creates a 500 error, you should be able to see details of the error in the file wp-content/debug.log.

You can paste those details in your next reply, or you could share the debug.log file itself via dropbox or wetransfer or similar, just paste the link in here.

July 26, 2023 at 11:23 am #14102963

celineM-6

Here are the content of debug.log file
[26-Jul-2023 11:21:47 UTC] PHP Fatal error: Uncaught Error: Call to a member function get_404_util() on null in /nas/content/live/sifawystg/wp-content/plugins/sitepress-multilingual-cms/classes/query-filtering/class-wpml-query-parser.php:505
Stack trace:
#0 /nas/content/live/sifawystg/wp-content/plugins/sitepress-multilingual-cms/classes/query-filtering/class-wpml-query-parser.php(380): WPML_Query_Parser->maybe_adjust_name_var(Object(WP_Query))
#1 /nas/content/live/sifawystg/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php(3411): WPML_Query_Parser->parse_query(Object(WP_Query))
#2 /nas/content/live/sifawystg/wp-includes/class-wp-hook.php(308): SitePress->parse_query(Object(WP_Query))
#3 /nas/content/live/sifawystg/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters('', Array)
#4 /nas/content/live/sifawystg/wp-includes/plugin.php(565): WP_Hook->do_action(Array)
#5 /nas/content/live/sifawystg/wp-includes/class-wp-query.php(1131): do_action_ref_array('parse_query', Array)
#6 /nas/content/live/sifawystg/wp-includes/class-wp-query.ph in /nas/content/live/sifawystg/wp-content/plugins/sitepress-multilingual-cms/classes/query-filtering/class-wpml-query-parser.php on line 505
[26-Jul-2023 11:21:47 UTC] PHP Fatal error: Uncaught Error: Call to a member function get_requested_lang() on null in /nas/content/live/sifawystg/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php:1131
Stack trace:
#0 /nas/content/live/sifawystg/wp-content/plugins/sitepress-multilingual-cms/classes/utilities/class-wpml-locale.php(106): SitePress->get_current_language()
#1 /nas/content/live/sifawystg/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php(3452): WPML_Locale->locale()
#2 /nas/content/live/sifawystg/wp-includes/class-wp-hook.php(308): SitePress->locale_filter('en_US')
#3 /nas/content/live/sifawystg/wp-includes/plugin.php(205): WP_Hook->apply_filters('en_US', Array)
#4 /nas/content/live/sifawystg/wp-includes/l10n.php(80): apply_filters('locale', 'en_US')
#5 /nas/content/live/sifawystg/wp-includes/l10n.php(139): get_locale()
#6 /nas/content/live/sifawystg/wp-includes/l10n.php(868): determine_locale()
#7 /nas/content/live/sifawystg/wp-includes/class-wp-fatal-error-handler.php(47): load_default_textdomain()
#8 [intern in /nas/content/live/sifawystg/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php on line 1131

July 26, 2023 at 1:41 pm #14104471

Nigel
WPML Supporter since 02/2016

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

Thank you for that.

I can follow what causes the error in a narrow sense, but not in a broader sense of what prompts it to occur.

Looking at your site debug info you shared, your WP Memory Limit appears too low—below the minimum requirements shared with you earlier. Did you raise the memory limit since submitting the debug info?

See this link for how to increase the memory limit; I would recommend similar settings for the WP_MEMORY_LIMIT and WP_MAX_MEMORY_LIMIT constants as in the example below.

https://wpml.org/faq/checklist-before-opening-a-ticket-in-wpml-support/#how-to-increase-your-sites-memory-limit

July 31, 2023 at 8:46 am #14124873

celineM-6

Hi Nigel, as I mentioned before that I checked the requirements before and the error still there including the memory limit
I attached a screenshot that shows the WP_MEMORY_LIMIT and WP_MAX_MEMORY_LIMIT which meet the requirements

sifawy-memory-limit.PNG
July 31, 2023 at 11:14 am #14126281

Nigel
WPML Supporter since 02/2016

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

OK, thanks for confirming. (The debug info you submitted shows different values memory but that can sometimes be inaccurate.)

To debug further I'll need to take a closer look at your site, if that's okay.

As this is a staging site is it okay for me to run some tests, including deactivating and reactivating plugins and possibly install utility plugins to help diagnose the problem?

If that proves inconclusive, I may need to copy your site to work on locally. Would that be okay?

If so, please share credentials in the private reply I've set for you. You may want to create a temporary admin user for me that you can later delete, and be sure to have a backup.

July 31, 2023 at 3:28 pm #14128567

Nigel
WPML Supporter since 02/2016

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

Thanks for that.

I deactivated all other plugins, activated WPML, and switched the language setting to use directories, to have a starting point to check WPML in isolation.

It appeared to be working fine, both on the back end and front end, no errors affecting the site.

So I gradually reactivated all of the other plugins that I had deactivated, and in the end I was able to reactivate all of them, again without creating any errors.

So now the site appears to be in the same state as when you shared it with me, without triggering the errors.

I'm not sure what would have responsible, as I don't seem to be able to reproduce them.

(The one thing I did see is that for some reason the wp-content/languages/wpml directory has had its permissions set to read-only, while it should be read-and-write. See the screenshot I took, using the Filester plugin to browse your files. That should be fixed, which you should be able to do using an FTP client, or you can ask your host to fix.)

Screenshot 2023-07-31 at 16.11.28.png