Skip Navigation

[Resolved] Fatal error when displaying a custom search View

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

Problem:
Client was seeing PHP fatal errors because of insufficient memory, even when setting these to be quite high (1024M).

Solution:
The site is very large, and the View was displayed without pagination, so that all 69,639 products were being loaded at once.

Adding pagination to the View fixed the issue.

This support ticket is created 6 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.

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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+01:00)

This topic contains 5 replies, has 3 voices.

Last updated by krishnaT 6 years, 5 months ago.

Assisted by: Nigel.

Author
Posts
#590036
allpluginson-Avadatheme.jpg
allpluginsoff-2017theme.jpg

I am trying to: Create a Custom Search page. I am following along step by step and got to the part where you insert your view into a page and click to view - all I get is a page with this message Fatal error: Allowed memory size of 2147483648 bytes exhausted (tried to allocate 83 bytes) in .../staging.topartllc.com/wp-includes/wp-db.php on line 1906. I had previously created a ticket for this problem, however I was working in the actual site. I have since created this staging site - so as previously requested I deactivated all plugins except toolset and changed the theme to the 2017 theme... I'm still getting the same error.

Link to a page where the issue can be seen: hidden link Please note this is a staging site so feel free to go in and test.

I expected to see: The search filters appear...as in the video

Instead, I got: a fatal error message

#590120

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Hi Veronica

For a memory allocation such as this you need the server to allocate more memory to WordPress.

From your debug info it looks like your server already has a generous memory limit, but WordPress may not be exploiting that.

You can try adding the following to your wp-config.php file and re-testing:

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

I tried to do it myself, but had problems with FTP on your site.

Could you try that and let me know if that fixes the issue?

#590701

I tried that still same error. I originally had this in there

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

#591128

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Hi Veronica

I took a duplicate of your site and experienced the same after installing locally.

I did note, however, that this is a very heavy site. I had to exclude the wp-uploads folder from the site duplicate because of its size, and the database is very large. On the local copy of your site I installed I tried to update to WordPress 4.9 and could not because of errors. I'm guessing this is an old site you have experimented on over time which has accumulated a lot of content, some of which is no longer actively used.

So I would say that your site has some issues, which don't originate with Views, but which manifest themselves when you try to display a View. I'm pretty confident that if you created a new site, migrating only what was required, you would have a more performant site.

In any case, I have escalated this thread so that our second tier can take a closer look and see if they can identify what is causing the specific issue when displaying a View.

I'll let you know when I hear back from them.

#591904

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Hi Veronica

A second pair of eyes from my colleagues helpfully noticed that you have no pagination on the View, and so it is trying to return and process all 69,639 products at once, which is causing the memory issue.

Edit the View to add pagination and it should fix the problem.

#1164652

[Resolved] I am having the same issue on my site.

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