Skip Navigation

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

Problem:
The client was unable to save the Divi Theme Homepage on their multisite and encountered a 'save failed' error. The issue disappeared when the WPML plugin was deactivated. Deleting the translated page did not resolve the issue.

Solution:
We imported the client's site locally for testing and did not encounter any issues with a 512MB memory limit. The error logs from the live site indicated a PHP fatal error due to the memory limit being exhausted. To solve this, we recommended that the client request their hosting provider to increase the PHP memory limit. Additionally, we advised the client to increase the WordPress memory limit by adding the following line to their wp-config.php file:

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

The wp-config.php file can be accessed and edited via SFTP. The current WordPress memory limit can be confirmed under WPML -> Support in the Info section. For more information on editing the wp-config.php file and adjusting memory limits, we provided a documentation link:

https://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP

If this solution does not seem relevant, please open a new support ticket at WPML support forum.

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 janH-80 1 year, 3 months ago.

Assisted by: Mateus Getulio.

Author Posts
January 20, 2024 at 7:58 am #15206910

janH-80

Hi,
I cannot save the Divi Theme Homepage in my site lofthotel.ch (part of multisite) anymore. I get an error that save failed. After testing I figured out, that the error dissapears when I de-activate the WPML plugin. I then tried deleting the translated page completely, but that did not solve the problem.
Here's screenshot of the error: hidden link
I kindly ask you to have a look into it.
Thank you
Kind regards,
Jan

January 22, 2024 at 3:04 am #15209236

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello there,

Thank you for your ticket with us.

In order for us to have a better understanding of the issue, I'd like your help enabling the debug mode, please add the following code to the wp-config.php file available in the webroot of the site:

// Enable WP_DEBUG mode
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 
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );
  
// Use dev versions of core JS and CSS files (only needed if you are modifying these core files)
define( 'SCRIPT_DEBUG', true );

Please check following links to read more about debugging with WordPress.
- https://codex.wordpress.org/Debugging_in_WordPress
- https://codex.wordpress.org/Debugging_in_WordPress#Example_wp-config.php_for_Debugging

After adding the code above, please try to reproduce the issue again and check if you'll find a debug.log file inside the wp-content folder.

If you locate it there, please send us the last lines here in the ticket.

Thank you, please let me know.

January 22, 2024 at 8:04 am #15209650

janH-80

Hello Mateus

I did add the code to wpml config: hidden link

Reproduced the error but there was no debug.log created in the wp-content folder. Maybe related to it being a multisite?

Thanks
Jan

January 22, 2024 at 10:05 am #15210235

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello there,

I would like to request temporary access (wp-admin and FTP) to your site to take better look at the issue. You will find the needed fields for this below the comment area when you log in to leave your next reply. The information you will enter is private which means only you and I can see and have access to it.

Our Debugging Procedures

I will be checking various settings in the backend to see if the issue can be resolved. Although I won't be making changes that affect the live site, it is still good practice to backup the site before providing us access. In the event that we do need to debug the site further, I will duplicate the site and work in a separate, local development environment to avoid affecting the live site.

Privacy and Security Policy

We have strict policies regarding privacy and access to your information. Please see:
https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/

**IMPORTANT**

- Please make a backup of site files and database before providing us access.
- If you do not see the wp-admin/FTP fields this means your post & website login details will be made PUBLIC. DO NOT post your website details unless you see the required wp-admin/FTP fields. If you do not, please ask me to enable the private box. The private box looks like this: hidden link

Please, let me know if you need any additional details. Have a nice day.

January 22, 2024 at 3:21 pm #15212447

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello there,

While debugging this, I noticed that when we hit the save button an error shows up in the console saying that a request to '/wp-admin/admin-ajax.php' failed within Cloudfware.

As a test, can you please(at least temporarily) add the /wp-admin/ to the allowlist/bypass of the Cloudfare waf rules:

hidden link
hidden link

If the issue persists after this, in order for me to debug this properly, I'd like to request your consent for me to make a local copy of your site that I'll remove as soon as we finish debugging this.

This is necessary to avoid causing any side effects to the live site and to test hosting-related specific issues.

Thank you, please let us know.

January 22, 2024 at 6:13 pm #15213130

janH-80

Could you send me a screenshot of the error? I need to go through Kinsta support since they are managing the whole Cloudfare integration. I also consent to your suggestion of making a local copy.

January 22, 2024 at 9:48 pm #15213621

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello there,

I'm attaching the screenshot with the error I'm referring to.

I need to make a correction, firstly, while checking the network tab I misread an info in the header that made me believe that the error was coming from cloudfare.

Upon further review I can't make this association, although the error is there, it doesn't necessarily come from the CDN.

I tried making a copy of the site using Duplicator but it seems like it was banned by Kinsta, I also tried creating a staging site using cloudways but it failed.

Is it possible for you to create a package of the site and upload it to the server where I can download it?

Thank you, please let us know.

consoleerror.jpg
January 23, 2024 at 7:27 am #15214210

janH-80

What do you mean by create a package of the site? Is there a tool to do that?

January 23, 2024 at 7:39 am #15214278

janH-80

Also I just got Feedback from Kinsta regarding the error. They checked their error logs as well and it's a memory exhaustion error, which is probably caused by plugin conflicts. Since disabling WPML solves the problem that is definitely the case I would say. Please advice on how I can make this package for you to debug. Thank you.

January 23, 2024 at 2:55 pm #15217772

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello there,

Thank you for letting us know about the memory limit issue. This is an important aspect to consider in resolving the issue.

1. Creating a Site Package:

Regarding the creation of a site package, you can utilize Kinsta's feature to generate a downloadable backup, as mentioned in their documentation: hidden link

After generating the backup, if the download link is restricted, please upload the zipped file to an FTP server. Let me know its location so I can access and download it for debugging purposes.

2. Regarding the memory limit issue:

Since the PHP memory limit seems also to be set at 256MB, it would be beneficial to increase this limit. This adjustment might help in resolving the memory exhaustion issue. To increase the PHP memory limit, you can follow these steps:

- If you have access to your php.ini file, locate the line memory_limit and change its value to 512M or 1024M.
- In case you don't have access to php.ini, you might be able to set this in your .htaccess file by adding the line php_value memory_limit 512M (or 1024M).
- If neither of these options is feasible, I would recommend reaching out to Kinsta’s support team, as they might be able to assist in increasing the limit from their end.

Please proceed with creating the backup and adjusting the PHP memory limit. Once done, let me know so we can continue with the debugging process.

Looking forward to your update.

Best regards,
Mateus

January 23, 2024 at 10:22 pm #15219079

janH-80

Hey Mateus,

Is there a way to send the download location for the package private? Or if you'd send me an email address I could send you an invitation through Google Drive to download it here. I just don't want to post this publicly here.
Thank you
Jan

January 23, 2024 at 10:46 pm #15219147

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

My apologies, I should have enabled the private fields upfront.

There you go now, thank you!

January 24, 2024 at 5:44 pm #15223207

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello there,

I've successfully imported your site locally for testing. Despite the large size of the site, which slowed down the import process, I didn't encounter any issues in my local copy with a 512MB memory limit.

Upon reviewing the error logs from the live site, I noticed the following entry repeating a bit:

[error] 84773#84773: *63857 FastCGI sent in stderr: "PHP message: PHP Warning:  Constant WP_DEBUG already defined in wp-config.php on line 123PHP message: PHP Warning:  Constant WP_DEBUG_LOG already defined in /wp-config.php on line 129PHP message: PHP Warning:  Constant WP_DEBUG_DISPLAY already defined in /wp-config.php on line 135PHP message: PHP Warning:  Constant SCRIPT_DEBUG already defined in wp-config.php on line 143PHP message: PHP Fatal error:  Allowed memory size of 268435456 bytes exhausted (tried to allocate 20480 bytes) in wp-includes/class-wpdb.php on line 2320" while reading response header from upstream, client: 81.193.13.127, server: multisitech.kinsta.cloud, request: "POST /wp-admin/admin-ajax.php HTTP/2.0", upstream: "<em><u>hidden link</u></em>:", host: "lofthotel.ch:64165", referrer: "<em><u>hidden link</u></em>"

The critical part of this log is the PHP fatal error indicating that the current memory limit of 256MB is insufficient for handling the request:

PHP Fatal error:  Allowed memory size of 268435456 bytes exhausted (tried to allocate 20480 bytes)

As your hosting support has pointed out, and as evidenced by these logs, a 256MB memory limit is not being enough here, especially for a WordPress multisite which tends to have higher memory requirements.

To resolve this issue, please request your hosting provider to increase the PHP memory limit. Once they have done this, you can further increase the WordPress memory limit by adding the following line to your wp-config.php file:

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

The wp-config.php file is located in the root directory of your WordPress installation, alongside your database configuration settings. You will need to access and edit this file via SFTP.

To confirm the current WordPress memory limit, you can check it under WPML -> Support in the Info section.

For more information on editing the wp-config.php file and adjusting memory limits, you can refer to this guide:

https://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP

Thank you!
Mateus

January 25, 2024 at 7:46 am #15224666

janH-80

Thank you Mateus. That helped. Can you please explain why you first suggested to adjust Memory limit in php.ini or .htaccess, but now in the last message in wp_config? Thank you.
Best,
Jan

January 25, 2024 at 10:45 am #15225562

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello there,

Thank you for sharing the results.

Regarding your question about the memory limits, from your debug info I got this:

PHP MemoryLimit	256M
WP Memory Limit	256M

The PHP Memory Limit, as set in the php.ini file or .htaccess, is a general limit for all PHP scripts running on your server. It's like a ceiling that no individual script can exceed.

On the other hand, the WP Memory Limit, which is set in the wp-config.php file, specifically governs how much memory can be consumed by WordPress scripts. While this limit can be set independently, it cannot exceed the overarching PHP Memory Limit.

Initially, I suggested adjusting the PHP Memory Limit because if it's set too low, simply increasing the WP Memory Limit wouldn't be effective. The PHP limit acts as a cap for the WP limit.

After confirming the PHP Memory Limit was sufficiently high, it became appropriate to adjust the WP Memory Limit in wp-config.php. This step was necessary because even with a high PHP limit, WordPress will only use the amount of memory specified in its own configuration.

In summary, both limits needed to be addressed: first ensuring the PHP Memory Limit was adequate, and then adjusting the WP Memory Limit to leverage the available resources.

I hope this clarifies the process for you. Please feel free to reach out if you have any more questions.

Best regards,
Mateus