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 thread is resolved. Here is a description of the problem and solution.

Problem:

Internal server error caused by misconfigured .htaccess with W3 Total Cache

Solution:

W3TC is one of the best caching plugins for WordPress, and it is compatible with WPML.

https://wpml.org/plugin/w3-total-cache/

Please make sure that you are following our instructions and suggestions on how to work with WPML and the w3TC plugin. You can see the documentation here.

https://wpml.org/documentation/plugins-compatibility/optimize-multilingual-website-performance-using-w3-total-cache/

Please note. The W3TC is a complex plugin that you need to know how to configure to work correctly. WPML is also compatible with other caching plugins. For example, the WP Super Cache. https://wpml.org/plugin/wp-super-cache/. This plugin is more simple to configure, so you might want to consider using it.

This topic contains 3 replies, has 2 voices.

Last updated by Itamar 3 months ago.

Assigned support staff: Itamar.

Author Posts
July 20, 2019 at 11:46 am #4249777

timurC

I am trying to:
use total cache in conjunction with wpml

Link to a page where the issue can be seen:
It's fixed for now – I commented out the problematic parts of the .htaccess and disabled the page cache, hoping it wont happen again.

The WP installation worked fine for some years now. The client requested multi lingual support so I installed WPML. It worked fine for some hours, and then every request resulted in a server error 500, also the admin part of WP was not accessible. It took me some time to figure out that it was a misconfiguration in the .htaccess, likely cause by total cache plugin. It adds a "RewriteBase ?lang=en" at situations that I was not able to reproduce. I deleted the line and it worked again, but it got automatically added some time later, making the error re-occur. I will append more of the .htaccess at in the end.

For now, I turned off the Page Cache and hope that it wont happen again. Unfortunately, some pages are really slow without the cache. I would like to turn it on again.

Are there strategies to prevent this from happening?

Thanks a lot in advance,

Timur

--removed by supporter--

July 21, 2019 at 8:16 am #4251587

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi.

W3TC is one of the best caching plugins for WordPress, and it is compatible with WPML.
https://wpml.org/plugin/w3-total-cache/
Please make sure that you are following our instructions and suggestions on how to work with WPML and the w3TC plugin. You can see the documentation here.
https://wpml.org/documentation/plugins-compatibility/optimize-multilingual-website-performance-using-w3-total-cache/
Please note the W3TC is a complex plugin that you need to know how to configure to work correctly. WPML is also compatible with other caching plugins. For example, the WP Super Cache. https://wpml.org/plugin/wp-super-cache/. This plugin is more simple to configure, so you might want to consider using it.

Also please note the following. By looking at the debug info that you have attached I can see that your server WP Memory Limit is set to 40M. Our recommendations are to have the following as minimal requirements:
- PHP 5.6 and above (this OK with your installation) with a WP Memory Limit of at least 128MB and more if possible.
- MySQL 5.6 and above.
Please follow this link for detailed documentation:
https://wpml.org/home/minimum-requirements/
Is it possible for you to change those to the minimum requirement?
You may need to contact your hosting provider for that.
Meeting those baseline requirements is most critical before starting to debug and sometimes solves issues (performance issues) like you experience.
Most important is to raise the WP Memory Limit.
Please try to raise it before you contact your hosting company.
You can try and do it from the wp-config.php file in your WordPress installation.
Insert this code in that file.

/** Memory Limit */
define('WP_MEMORY_LIMIT', '256M');
define( 'WP_MAX_MEMORY_LIMIT', '256M' );

Add it before this line:
/* That's all, stop editing! Happy blogging. */

Please let me know if this information is helpful to you?

P.S. FYI, This forum is public therefore for your site's safety I've removed the .htaccess code that you have added here.

Best Regards,
Itamar.

July 21, 2019 at 10:00 am #4251965

timurC

Thanks for the advices! I upped the memory limit to 256 but did not feel an immediate difference.

I switched the caching to WP super cache and I am very happy, it feels better that it does not interfere with the .htaccess. It also does not seem to be slower than Total Cache so far, still get 97% performance score from the Chrome dev tool audit.

Thank you very much!

July 21, 2019 at 12:47 pm #4252167

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Great, I'm glad that it is solved now!

Good luck with your web projects 🙂
Itamar.