Enabling REDIS breaks inputs, Call to undefined function utf8_encode() input_model.php on line 332

Hello - I know this problem has been cropping up in lots of places, but nothing in the other threads seemed to make me think that this was exactly what was going on… Here’s my details: gets me Fatal error: Call to undefined function utf8_encode() in /usr/local/www/apache24/data/emoncms/Modules/input/input_model.php on line 332

Turning REDIS off in settings.php yields me a glorious pile of JSON:

[{“id”:“1281213”,“nodeid”:“openevse”,“name”:“amp”,“description”:"",“processList”:"",“time”:“1526630715”,“value”:“0”}, and so on.
One thing I noticed is that in phpinfo redis shows as version 4.0.2, and in the server info page it shows as 4.0.9

Server is as such:

Server Information
Emoncms Version 9.8.30 : 2018.05.08
Modules Administration : App v1.1.0 : Dashboard v1.2.0 : EventProcesses : Feed : Graph v1.2.0 : Input : CoreProcess : Schedule : Time : User : Visualisation
Server OS FreeBSD 11.0-RELEASE
Host emoncms localhost (
Date 2018-05-18 01:27:12 PDT
Uptime 1:27AM up 22 days, 2:34, 1 users, load averages: 0.15, 0.17, 0.17
HTTP Server Apache/2.4.33 (FreeBSD) PHP/5.6.36 HTTP/1.1 CGI/1.1 80
MySQL Version 5.6.40
Host localhost (
Date 2018-05-18 01:27:12 (UTC -07:00‌​)
Stats Uptime: 1226 Threads: 1 Questions: 3050 Slow queries: 0 Opens: 72 Flush tables: 1 Open tables: 65 Queries per second avg: 2.487
Redis Version 4.0.9
Host (
Size 23 keys (1.06M)
Uptime 0 days
PHP Version 5.6.36 (Zend Version 2.6.0)
Modules apache2handler : Core v5.6.36 : ctype : curl : date v5.6.36 : ereg : filter v0.11.0 : gettext : hash v1.0 : json v1.2.1 : libxml : mcrypt : mhash : mysql v1.0 : mysqli v0.1 : mysqlnd : pcre : redis v4.0.2 : Reflection : session : SPL v0.2 : standard v5.6.36 :

Client Information
HTTP Browser Mozilla/5.0 (X11; CrOS x86_64 10323.67.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.209 Safari/537.36
Screen Resolution 1920 x 1080
Window Size 1920 x 941

The fatal error on 332 is probably telling. I’ve flushed REDIS more times than I can count, database updated + checked, git pulled, and pkg update’d everything I can think of. emoncms.log only has a few expected errors about feeds I deleted a while ago.

REDIS enable = true also breaks the activity of the inputs to the feeds, and not just the page showing them. Feeds just don’t update.

I’m also running this server in it’s own freebsd jail, but I run lots of stuff in jails, so it seem irrelevant.

Thanks! I hope there’s an easy fix (that I can do)

I haven’t looked into this closely, but if you are still having troubles with this, could you please try backdating php-redis to an earlier version to test?

sudo pecl install redis-3.1.6
sudo redis-cli flushall
sudo service apache2 restart

Whilst we haven’t had any feedback yet, we are aware there were some “code breaking changes” in post v4 versions (their words not mine/ours).

The seerver info shows the Redis SERVER as version 4.0.9, but the Redis extension for PHP (php-redis) is reported as “redis v4.0.2” in the last “PHP - Modules” section.

Something else you might want to try, is commenting out line 332 from input_model.php, it was recently left out during a reshuffle after being introduced to fix an issue with the inputs page not loading quite a while back, it was only fixed again a couple of weeks ago, so emoncms will/should work without the “$row[“description”] = utf8_encode($row[“description”]);” line, but might just fail to show the inputs page in a browser but inputs should be processed ok.