PHP Version trouble & How to Fix It

I have two websites, both of which have been around for about 10 years. The PHP running on them is old.

PHP Errors are strong text in public_html/error_log
When using the Sparkle Search feature, one of three which needs PHP, I get no search results.

In error_log in the root of the public_html I get errors like the following:
PHP Fatal error: Uncaught Error: Call to undefined function mb_str_split() in /home1/gregluck/public_html/search.php:315
Stack trace:
#0 /home1/gregluck/public_html/search.php(334): rev_string(‘Sustainable Eco…’)

What Version do you need for Sparkle?
I saw in on of Duncan’s posts he recommends 5.6.30 or higher. My site had 5.6.30 and had the problem. So it seems we need something newer than this.

How to Tell what version PHP you are running?

This will print out your site’s PHP info.

You can also edit search.php and add an error_log statement to print this info out.

error_log('Current PHP version: ' . phpversion(), 0);


Upgrading your site’s PHP version
Upgrading your site’s PHP version in my experience twice now requires a support ticket. They seem able to do it quickly. They upgraded me to 7.4.16 and my search errors went away.

1 Like

Sorry yeah we found a bug in our search php that is indeed limiting it to only work with 7.4. The upcoming Sparkle 3.0.9 will fix this.

PHP 5.6 is still the baseline Sparkle requires to work with international character support, but it’s an ancient PHP version that is no longer recommended due to it no longer being actively maintained by the PHP development team (i.e. it might have security vulnerabilities).


Is the search then also backwards compatible with PHP 7.3?
With some providers the info page is also called infophp.php

Mr. F.

Not sure about 7.3. Not sure what you mean about infophp.php.

I wanted to point out that the name could be different in some cases. Nothing else.

Mr. F.