[Resolved] Toolset types not working with PHP 7.x on Siteground.com hosting!
The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This thread is resolved. Here is a description of the problem and solution.
Problem:
Toolset Types plugin not working with PHP 7.x on Siteground.com hosting.
Edit page returns 500 internal server error or or I get an error like this:
Fatal error: Allowed memory size of 805306368 bytes exhausted (tried to allocate 8589934648 bytes) in /public_html/wp-admin/includes/admin.php
Solution:
Basically it's an OpCache issue on the server side. Please follow below steps to resolve it:
1. Add this in wp-config.php file of your site:
ini_set('opcache.file_cache_only','1');
2. PHP 7 OpCache functionality is enabled by default. The folder which is used by PHP 7 to store the opcache is: /home/user/.opcache
If you want to clear the cache you can simply delete this whole .opcache directory.
- If the above code does not work, then you can try this one as well:
This support ticket is created 7 years ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.
1. This is memory issue, PHP Memory limit being hit on the server. PHP 7.x requires more memory, please contact your website hosting company to upgrade PHP memory to 256MB.
2. After that please make sure to increase WP memory limit to 256Mb.
Add this to the top of wp-config.php to increase WP memory:
But to no avail. Only works correctly with PHP 5.6.
I see many issues on the site relating to PHP 7.X... It must be a deeper issue at play here. Maybe not relating to Toolset specifically. After searching the web, I can see that other plugins have memory issues with PHP 7.X too. This is worth investigating further.
Myself, I can run fine with 5.6 for now, so it's not urgent but please know that this issue is present for me and many others certainly, t's just that many hosts just do not use PHP 7 by default.
Thank you for getting back to us. I certainly understand your concern, but there is nothing much our plugin can do in this case. Basically memory requirements involve overall environment (active theme, active plugins, etcβ¦) so it is possible that the your set of environment requires more memory than the others.
- I am also running my test Toolset site on PHP Version 7.0.16-2 and I am not seeing any issues. On some servers php.ini file settings are ignored over the server setup configurations, to confirm this you can contact hosting support and also you can see this info inside Toolset Debug Information by going to WP Dashboard >> Toolset >> Settings >> Toolset Debug Information (link at bottom of page).
Yes Norman, I fully understand, this has to do with Siteground, because both Toolset debug and Avada debug both give me "MemoryLimit":"768M ... Which is too much!
Norman, here's what Siteground advanced support team uncovered, maybe this can help you debug this. So the problem has to do with opcache.
---
Now, for the problem:
I tested with both PHP 7.0 and PHP 7.1. In both my tests the Dashboard was failing each time I went to Pages -> All Pages -> Edit (editing a random page).
I straced the process and the last system call for "open" related to your plugins was:
Thanks for sharing these details. I can see now that it's basically a cache issue. Havenβt they suggested you to delete all caches and check it again?
1. Please clear out your website cache, plugin cache (SG Optimizer cache), server cache, browser cache too >> then Activate toolset and see if problem is solved after that or not.
2. Above should resolve the issue but if it continues then for debugging this issue I will need to take a look at your setup. So I need to request temporary access (WP-Admin & FTP) to your site
β preferably to a test site where the problem has been replicated if possible β in order to be of better help and check if some configurations might need to be changed.
Your next answer will be private which means only you and I have access to it.
=== Please backup your database and website ===
β I would additionally need your permission to de-activate and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important.
Thank you for your fast answer. All cache are cleared and turned OFF in Siteground CPanel. I also manually deleted .opcache in the user root folder, but to no avail. The problem still here.
I cannot give you user level FTP (it's a client site), but local test site level FTP, you can set php.ini files and stuff and should have plenty of room to operate as you wish. Clearing the .opcache didn't do any good anyway.
[Credentials-removed]
You can mess this test site all you want ?
I'm sorry in advance, I will not be available to reply this Weekend.
I have thoroughly debugged your site and this issue. During debugging I have seen various strange issues, at weird things happening, also when I disable Justified Image Grid plugin or Avada theme >> I was able to edit pages without any problem. And same is the case whenever I disable Toolset plugin.
I found out that there is something wrong in database table or database records are corrupted somehow or WP core files were corrupted which were throwing errors as well, even when we disable the above mentioned plugins.
So I changed table_prefix value to 'wp3_' in the wp-config.php file and this way I have installed a fresh WP in the same database. Now all the same plugins as we had originally are working perfectly fine, as you can edit the pages here and there are no serious errors. You can now Edit any page, Create new page etc while Toolset Types plugin, all third-party plugins and Avada theme are active:
- Edit Page: hidden link
- Preview Page: hidden link
The original database tables or site is still there and you can access it by changing table prefix value in wp-config.php file as below and this way you can see the old site:
table_prefix = 'ra_'
2. The above experiment clearly indicates that there is something corrupted in original WP database tables or in WP core files got corrupted in your site due to which PHP memory and other php errors were appearing. And as soon as we install a new WP installation, all plugins and theme is working fine including Toolset as shown in the above links.
So we recommend to either fix the WP installation or install a fresh WP site and move your site content, plugins and themes there manually using WordPress export xml tool.
3. Additionally, there is also a PHP Deprecated error I noticed coming from justified-image-grid plugin (please see attached screenshot): hidden link
The same error can also be found in β /wp-admin/php_errorlog β file
Noman, wow!! for this thorough debug! So it was neither toolset nor it's compatibility with Siteground and php 7.1, as I can attest, the test site works perfectly. So like you said, I will have to check what's strong with my main install core files or Db. Thank you so much!!
I am writing this just for the purpose of sharing some useful information with you, since you took so much of your time to try to help me, I owe you.
I have stopped using Toolset Types, but this problem was still here when using PHP 7+ on Siteground, various plugins like Yoast SEO where still causing 500 errors, so after searching the web extensively, everything pointed to opcache again.
Turns out that changing this setting via wp-config.php, and deleting the .opcache directory in user home, fixed the problem:
ini_set('opcache.file_cache_only','1');
Another solution that I did not try, but could work is:
I'm having the same problem, I'm on SiteGround with the Divi Theme and getting a 500 error after upgrading to php 7.0. The only thing to restore the site to working after upgrade to 7.0 is to deactivate the toolset plugins. I've tried all of the wp-config options, still no success.
The forum ‘Types Community Support’ is closed to new topics and replies.
This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.