[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.
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
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.
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.