Skip Navigation

[Resolved] Fatal out of memory errors when trying to get to edit template page

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 23 replies, has 2 voices.

Last updated by Waqar 9 months, 1 week ago.

Assigned support staff: Waqar.

Author
Posts
#2290253

I keep getting fatal out of memory errors when trying to get to an edit template page. I've added the following to the wp-config.php file:

define( 'WP_MEMORY_LIMIT', '2048M' );
define( 'WP_MAX_MEMORY_LIMIT', '2048M' );

That should be wayyyyy more than enough to handle this. I realize we have a very large number of plugins enabled, but we need all the ones we've installed to achieve the site functionality needed. We're trying to migrate from Drupal to WordPress and this is all stuff that we have working fine in Drupal, but in WordPress we're needing more plugins than is healthy for the site.

The fatal errors seem to only happen when we're trying to edit a template. i'm not sure if that's because of the block editor or not. We have the classic editor in use throughout the site other than editing the templates through your plugin. We do have Elementor and WPBakery installed as part of the theme we are using and we may use these as we study their demo content more in depth. But right now, we're just trying to get our already existing pages, content and functionality working in WordPress. So far, it's going mostly well, but these fatal errors are making things difficult.

Here are the last two we've gotten from trying to get to the edit template page from the Toolset dashboard:

[12-Feb-2022 04:42:22 UTC] PHP Fatal error: Out of memory (allocated 243269632) (tried to allocate 131072 bytes) in /home3/fyccnorg/public_html/shop-fyccn-org/wp-includes/media-template.php on line 1213
[12-Feb-2022 04:43:39 UTC] PHP Fatal error: Out of memory (allocated 243269632) (tried to allocate 126976 bytes) in /home3/fyccnorg/public_html/shop-fyccn-org/wp-admin/edit-form-blocks.php on line 295

I'm thinking we may need to move this site to VPS hosting. Is it possible that my increasing the memory to 2048M isn't being respected on our shared host? Or is it that 2048M isn't even enough? I've never had to go higher than 512MB on a site before getting these errors trying to get to your edit template page. But now even 2048M isn't stopping it. Any advice here that solves it would be hugely appreciated.

#2291507

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting us and I'd be happy to assist.

Usually, the shared hostings don't allow setting the memory limit to such a higher value. If you'll go to WP Admin -> Tools -> Site Health -> Info, you'll see the actual available 'PHP memory limit' under the 'Server' tab.

If you see a lower value, you can consult your hosting support team to see if it is possible to increase the PHP memory limit to a higher value. If not, it would be better to shift to a VPS server, where more server resources are available.

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar

#2291633

Under site health info server section, it's showing

PHP memory limit
2048M

We're not getting these errors with anything other than going into the edit template page. I don't think it is one specific plugin causing it, but I have noticed that it starts working when I disable Jetpack more often than not. Next time it happens, I'll try disabling Jetpack first. I haven't done that yet. I've disabled other plugins that we need less first, and then that didn't work, so I'd disable Jetpack and it would start working. I'll start with Jetpack next time.

I'll advise that we move to VPS hosting, but that still might not solve this. Any other possibilities?

#2291645

Jetpack isn't causing it. I just got the error with it disabled first. After that I disabled Elementor and WPBakery and the error stopped. Other times I've disabled Elementor and WPBakery first but that didn't stop it, but then disabling Jetpack would stop it. Those three plugins are major resource hogs so disabling all 3 seems to be the solution. But we need at least one of Elementor or WPBakery and I think we need Jetpack for other functionality. I haven't yet determined if we need Elementor or WPBakery as it relates to the theme demo content yet, but I think Elementor will be the one we keep if we have to choose one. I can't fathom why 2048MB wouldn't be enough though. Why are we only getting the error when we go into the Toolset template editor?

#2292503

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for sharing these results and yes, 2048MB memory should have been enough.

Are you experiencing this while editing any particular Toolset content template editor or for all?

You're welcome to share a clone/snapshot of the website so that we can investigate this on a different server.
( ref: https://toolset.com/faq/provide-supporters-copy-site/ )

Note: I've set your next reply as private.

#2293393

Note that I've determined this only happens when trying to enter the Block editor in Toolset. I have a template that I switched to the classic editor and it's working fine regardless of what plugins are installed. I'm not 100% sure if it is happening for all Block Editor templates or not. I think it is, but I'll have to double-check that to be sure for you.

I'm OK with sharing a snapshot of the website, but I can tell you from past experience that I seriously doubt the Duplicator plugin will work on this site. It is on shared hosting and the site is HUGE. I'm 99.99% sure it will trigger one of the failures for Duplicator. I've generally only had a 50/50 success rate with being able to clone sites with Duplicator. Let me know if you have another approach we should try.

Or I can just keep reporting circumstances around the error situation as I discover them.

Discussions are underway for moving this site to VPS hosting, but it might take awhile before that happens. It has to get approved first and then we have to determine if we want it on a separate host or if we want to move it to a parent company's VPS server.

#2294505

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

It is expected that the blocks editor environment requires more resources as compared to the classic/legacy editor. The content in the classic/legacy editor is only rendered and processed on the front-end.

I would recommend focusing on these points:

1. Is the issue being experienced while editing any content template or a specific one?
2. If it is only a specific content template, does reducing the amount of content in the template or removing any particular block, make any difference?
3. Get in touch with your current host and confirm that the 2048MB of memory is actually consistently available to WordPress?

Even if is a huge website, I can try using the Duplicator Pro plugin to download a selective duplicator package to see if it works. Along with your observations about the above points, you're welcome to share temporary admin login details, if you'd like me to proceed with that.

I'll wait to hear back from you and your next reply is set as private.

#2296457

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for sharing the admin access.

From looking into your website's settings, I noticed that the script debugging is turned on.

Please check your website's "wp-config.php" file and make sure that the 'SCRIPT_DEBUG' constant is set to 'false':


define( 'SCRIPT_DEBUG', false );

After making this change, see if the content template editing issue is fixed.

#2296975

I'll double-check it later tonight, but just wanted to send you the quick reply to let you know that I turned on debugging to try to figure out what was causing the fatal errors. It's just a standard out of memory error.

Right now I can't do it because I just did a 79 mile bicycle ride and I am too sore to move or do anything. 😉 I'll reply again later on after I get some sleep/rest. I wanted to reply quickly here though because the errors were happening before I turned on debugging.

#2298307

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thanks for the update and I'll wait to hear back from you.

#2299387

I set the site to not show errors in the wp-config file and I still can't get into the block editor without disabling certain resource hog plugins without getting the fatal error.

#2299447

I set it back to showing errors in the wp-config file now in case anything provided there will be helpful to us.

#2300687

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

{ticket status updated}

#2300791

Just checking in because the thread says "Waiting for user feedback". I wanted to make sure you weren't waiting for anything from me at this point. If you can use Duplicator Pro, I guess proceed with that.

#2301629

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

I thought we were waiting for an update from your side about the discussion with the hosting provider and the effect of 'SCRIPT_DEBUG', to 'false'.

If you'd like me to proceed with the duplicator package, please check the username and password again. When I try to log in to the admin area, the username and/or password are not getting accepted.