Skip Navigation

[Resolved] Does Toolset not work with PHP 8?

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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 4 replies, has 1 voice.

Last updated by Minesh 6 hours, 6 minutes ago.

Assisted by: Minesh.

Author
Posts
#2795646
Screenshot.png

I am trying to:

Update this site from PHP 7.4 to PHP 8 but when I do the site crashes with a critical error. Changing it back to 7.4 and the critical error goes away

There are vulnerablities in PHP 7.4 so I'm surprised WPMLwont' work on PHP 8

#2795657

I Googled it and apparently WPML should work with PHP 8+ but it's crashing this site

#2795660

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Toolset and WPM both can run with PHP 8. We also recomond that you should run your site with latest PHP version.

If you check with blogpost article:
=> https://toolset.com/2024/05/toolset-1-6-15-updates-for-wordpress-6-5/
You will see a sectino "Compatibility with PHP 8.1 and 8.2":

I'm not sure why your site is crashed and what is the reason. To know the reason - please first setup a test/staging site and update the PHP version to PHP 8.x there and check if site crashed. If you see site is crashed - please send me admin and FTP access details.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and 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.

I have set the next reply to private which means only you and I have access to it.

#2795661

It is a staging site but it's a fully built out site ready to be pushed live. If I update to PHP8 you can't access the site because it crashes

#2795662

Please provide the private reply option and I can give you admin access to the site but only with it running PHP 7.4 because upgrading to PHP8 and above crashes teh site

#2795663

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

You should update the site to PHP 8 and then send me stating site admin and FTP access details.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and 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.

I have set the next reply to private which means only you and I have access to it.

#2795667

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

With the site you shared - I do not see you are using Toolset plugins. Are you?

I see you are using WPML plugin - thats fine. You should update to PHP 8 so that we know what is the error and what we need to do in order to fix this and to verify that is the error coming from Toolset (if you are using it) or WPML or any other third party plugin or theme.

Can you please update the PHP version and let me know.

#2795669
Screenshot.png

I'm sorry -- yes, this site is using WMPL but that's part of Toolset plugins.

The PHP version is currently 7.4. When i upgrade to 8 and above the site crashes.

I've just updated to 8.3

#2795677

Are you working on this, because the site is still down with the critical error from updating to PHP 8.3

#2795680

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I've enable the WP_DEBUG and I can see the issue is from the theme file:

I can see the following fatal error:
=> hidden link

Fatal error: Uncaught Error: Call to undefined function create_function() in /var/www/staging.navavet.com/htdocs/wp-content/themes/nava-oren/functions.php:57 Stack trace: #0 /var/www/staging.navavet.com/htdocs/wp-settings.php(672): include() #1 /var/www/staging.navavet.com/wp-config.php(137): require_once('...') #2 /var/www/staging.navavet.com/htdocs/wp-load.php(55): require_once('...') #3 /var/www/staging.navavet.com/htdocs/wp-login.php(12): require('...') #4 {main} thrown in /var/www/staging.navavet.com/htdocs/wp-content/themes/nava-oren/functions.php on line 57

As you can see the fatal error is coming from the theme:

themes/nava-oren/functions.php on line 57

Can you please try to switch the theme for a moment and check if that help you to at least site loading without any issues.

#2795687

What is on line 57 is related to a fix used for WPML

// Fix Translation view issue

add_filter( 'wp_default_editor', create_function( '', 'return "html";' ) );

I have commented it out which does allow me to upgrade to PHP 8.3 (thank you!) however, do I need this code snippet that must have been provided by your support at some time in the past?

#2795689
Screenshot.png

Also can you please turn off whatever you activated that is showing errors.

#2795695

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

What if you try to replace that existing line of code:

add_filter( 'wp_default_editor', create_function( '', 'return "html";' ) );

With the following lines:

add_filter( 'wp_default_editor',function(){
    return "html";
});
#2795696

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I've also disable the WP_DEBUG from wp-config.php.

#2795697

Yes, that works. Thank you so much, Minesh.

If you can just deactivate the errors showing on the site -- it looks like you enabled WP debug and I can't turn it off -- that would be great 🙂