Skip Navigation

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

Problem:
I can't access plugins.php and some WPML admin pages. the site shows 500 errors and I can't deactivate WPML.

Solution:
The issue was caused by a custom code in the functions.php file of the child theme, this code was activating WPML multiple times which caused a memory issue.

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 15 replies, has 2 voices.

Last updated by Steja 1 year, 10 months ago.

Assisted by: Mohamed Sayed.

Author Posts
May 19, 2022 at 3:23 am #11251853

Steja

can't access plugins.php and some wpml admin pages , receive 500 error

i run alot of plugins but it's definitely less than 31,820

please advise
thanks

wpml.JPG
May 19, 2022 at 10:30 am #11255517

Mohamed Sayed
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi there,
Thanks for contacting WPML support.

- Please check with the hosting provider if the server error log shows any errors.

- Also, please provide me with the WordPress debug.log, this will allow us to see if any PHP errors are being produced. More Info: https://wordpress.org/support/article/debugging-in-wordpress/

To enable it, open your wp-config.php file and look for:

define('WP_DEBUG', false);

And change it to:

define('WP_DEBUG', true);
// Enable Debug logging to the /wp-content/debug.log file
define('WP_DEBUG_LOG', true);
// Disable display of errors and warnings which is recommended on a live site.
define('WP_DEBUG_DISPLAY', false);
@ini_set('display_errors',0);

Then try to reproduce the issue and check if any errors were saved to the debug.log log file inside the /wp-content/ directory
If you can paste your debug.log to https://pastebin.com/ and provide me that link, it would be great!

- The debug information of your site shows two issues that need to be fixed, they might be not related to the main issue but both are required for WPML to work properly.

1) Please upgrade your MySQL version to 5.6 or above (This is the minimum required MySQL version for WPML). You can also check with the hosting provider about this. Kindly check here for more details: https://wpml.org/home/minimum-requirements/

2) Please increase the WordPress Memory Limit. According to your Debug.info, the WP memory limit needs to be increased. PHP memory is fine, but WordPress uses 40Mb as default. Minimum requirements for WPML is 128Mb. (Kindly check this page https://wpml.org/home/minimum-requirements/)

You can increase it by adding the following code in your wp-config.php file, right before the /* That’s all, stop editing! Happy publishing. */ line:

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

Let me know please how it goes.

Regards,
Mohamed

May 19, 2022 at 11:02 am #11255949

Steja

-debug log: https://pastebin.com/kXuRpydh
-Mysql is Maria 10.1 on cloudways
-memory limit updated

thanks

May 19, 2022 at 2:54 pm #11258263

Mohamed Sayed
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi,

The debug log shows the following error:

PHP Fatal error:  Allowed memory size of 268435456 bytes exhausted (tried to allocate 20480 bytes) in ******/public_html/wp-includes/class-wp-fatal-error-handler.php on line 72

So the issue is related to a lack of server resources, I suggest contacting the hosting provider so they can check the memory issue and fix it.

Regards,
Mohamed

May 20, 2022 at 5:05 am #11262303

Steja

[20-May-2022 04:42:16 UTC] PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in
/*****/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/xml-config/transform/class-wpml-xml2array.php on line 63

512 mb memory now, issues happen when i try access wpml settings page or the plugins page in general

May 20, 2022 at 11:49 am #11265433

Steja

Issue persistent after switching themes and deactivating all plugins. can not deactivate
WPML Multilingual CMS

May 21, 2022 at 4:48 pm #11271387

Mohamed Sayed
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi,

To best troubleshoot the issue, kindly create a copy of your site and provide a link to download it. You can use the Duplicator plugin (https://wordpress.org/plugins/duplicator/).

The plugin will create two files (Installer and Archive) which you can download then upload again to Google Drive or Dropbox and share the download link in the next reply which I have marked as private. Then I’ll debug the issue locally to find the problem.

Please note: It is important to reduce the size of the package so please exclude some paths like /cache or /uploads and also exclude archives and media files.

Thanks for your cooperation.

May 22, 2022 at 8:13 pm #11274359

Mohamed Sayed
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi,
Thanks for providing the site copy.

I imported the site locally to check it when I got the following fatal error:

PHP Fatal error:  Out of memory (allocated 364904448) (tried to allocate 20480 bytes) in *****/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/xml-config/transform/class-wpml-xml2array.php on line 85

After testing many things, I found that deleting the redis-cache-pro.php plugin from the mu-plugins folder fixes the issue. Now I can access the site without any errors and the number of active plugins is correct (Please check the attached images).

So kindly try deleting the mentioned mu-plugin temporarily and check if the issue is resolved.

Regards,
Mohamed

Active plugins.png
May 23, 2022 at 1:35 pm #11281015

Steja

Hi, i managed to delete the mu-plugin. problem persists.

If i press "Reset and decativate WPML" everything works fine, when i run WPML setup again, it wont load the finish button on last setup page and problem is back.

from cloudways support: the error doesn't seem to be related to the server nor the object cache plugin.

May 23, 2022 at 8:28 pm #11284089

Mohamed Sayed
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi,

I've imported the site copy to one of our testing servers on Cloudways, and I got the same results I shared in my previous reply. I don't see any issues once I delete the MU plugin.

Please use the login details in the private reply above, and check if you can replicate the issue then share the steps with me.

Regards,
Mohamed

May 24, 2022 at 1:54 am #11284943

Steja

hi, thanks for your response.

yes the initial error not there on your test server. There are no translated products/pages in your test server version. can i send you login for my test server please

May 24, 2022 at 2:07 am #11284987

Steja

Also this error appear on your test server:

Error Details
=============
An error of type E_ERROR was caused in line 482 of the file ***/public_html/wp-content/plugins/types/vendor/toolset/types/includes/fields.php. Error message: Out of memory (allocated 51052544) (tried to allocate 32768 bytes)

May 24, 2022 at 8:45 am #11287891

Mohamed Sayed
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi,

1) Please provide me with temporary access (WP-Admin and FTP) so I can investigate this issue further.
– preferably to a test site where the problem has been replicated if possible –

Your next answer will be private, which means only you and I have access to it.

❌ Please backup your database and website before providing us with access details ❌

✙ I would additionally need your permission to de-activate and re-activate Plugins and the Theme and to change configurations on the site if needed. This is also a reason the backup is critical.

✙ I would also need your permission to take a local copy of your site to debug the issue without affecting your live site.

2) Please tell me more details about the steps to see the issue and where exactly I can see it on your site.

Thanks for your cooperation

May 24, 2022 at 9:12 pm #11297137

Mohamed Sayed
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi,

I couldn't find any clues, so I escalated the issue to the 2nd tier support team. I will update you once I get their reply.

May 25, 2022 at 3:33 pm #11307821

Mohamed Sayed
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi,

Our 2nd tier supporters found that the issue is most probably related to a custom code in the functions.php file of your child theme. This code activates WPML thousands of times which overloads the logic to load the XML files and check them each time the plugin is activated.

Kindly try the following steps which worked for us:

1. Create a full database and website backup
2. Edit the functions.php file of your child theme
3. Comment or remove the following code:

function activate_plugin_wc() {
    $active_plugins = get_option( 'active_plugins' );
    array_push($active_plugins, 'sitepress-multilingual-cms/sitepress.php'); /* Here just replace  plugin directory and plugin file*/
    update_option( 'active_plugins', $active_plugins );    
}
add_action( 'init', 'activate_plugin_wc' );

4. Open your database using phpMyAdmin(or another database manager)
5. Go to the wp_options table (You need to replace wp_ with your WP table prefix)
6. Find the option key "active_plugins" and delete it
7- Go to Dashboard > Plugins and re-activate the necessary plugins

Let me know please if that helps.

Regards,
Mohamed

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.