Skip Navigation

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

ini_set('opcache.interned_strings_buffer','8');

Relevant Documentation:
https://www.siteground.com/blog/php-7-with-opcache/

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.

Sun Mon Tue Wed Thu Fri Sat
- 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 -
- 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 -

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

This topic contains 13 replies, has 3 voices.

Last updated by scottW-11 7 years ago.

Assisted by: Noman.

Author
Posts
#504766

I am trying to: Make the toolset types plugin work on Siteground shared hosting with PHP 7.x

I visited this URL: any edit page url

I expected to see: the normal edit page

Instead, I got: a 500 internal error, or I get a random error, and one consistent one is:

Fatal error: Allowed memory size of 805306368 bytes exhausted (tried to allocate 8589934648 bytes) in /home/reservea/public_html/wp-admin/includes/admin.php

After downgrading to PHP 5.6 everything works fine, so types seems to have some kind of memory leak with PHP 7.x.

Please investigate and fix.

#504807

Noman
Supporter

Languages: English (English )

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

Hi Karim,

Thank you for contacting Toolset support.

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:

/** Memory Limit */
define('WP_MEMORY_LIMIT', '256M');
define( 'WP_MAX_MEMORY_LIMIT', '256M' );

Please let me know if this resolves the issue.
Thank you

#504838

Hello Norman,

I just re-did all of this...

1/ set in php.ini.

memory_limit=256M

2/ set in wp-config.php

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

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.

Cheers

#504884

Noman
Supporter

Languages: English (English )

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

Hello,

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

- You can also share the debug information with us if you wish to. I have enabled debug info box for your next reply: https://toolset.com/faq/provide-debug-information-faster-support/

If we notice there is anything that needs fixing on our end, we will be more than happy to adjust or fix for sure. Have a great day.
Thank you

#504891

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!

#504934

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:

open("/home/reservea/.opcache/000742e403be270308751258319966ad/home/reservea/public_html/sitegroundtest/wp-content/plugins/types/library/toolset/types/embedded/includes/import-export.php.bin", O_RDONLY) = 6

It appears that he "types" plugin is struggling to work with PHP 7.x and cannot benefit from the opcache.

After disabling the plugin everything went back to normal.

Note that nothing has been changed other than setting the PHP version to 7.1 and deactivating the "types" plugin.

#504962

Noman
Supporter

Languages: English (English )

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

Hello Karim,

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?

- As long as I know, SiteGround automatically install SG Optimizer cache plugin in your site:
https://wordpress.org/plugins/sg-cachepress/

- This article also inform that how to delete OpCache:
hidden link


" The 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 the whole .opcache directory. "

--------------------------------------------------------------------------------------------------------------------------------

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

#505101

Hello Norman,

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.

Thank you and keep up the wonderful work.

Kind regards,

Karim

#505105

Please don't forget to make my previous message private! Otherwise, some automated bots or hackers are going to enjoy this πŸ˜› Thank you so much.

#505308

Noman
Supporter

Languages: English (English )

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

Hello Karim,

Thank you for providing login details. I have removed the login details from message.

I am working on this issue and will get back to you soon with an update.

Thank you for your patience.

#505541

Noman
Supporter

Languages: English (English )

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

PHP Deprecated error.jpg

Hello Karim,

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

Have a great weekend, Thank you

#505983

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!!

#510503

Norman,

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:

ini_set('opcache.interned_strings_buffer','8');

Enjoy!

#564788

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.