# Php-redis not recognised by php \[solved\]

**URL:** <https://community.openenergymonitor.org/t/php-redis-not-recognised-by-php-solved/13851>\
**Category:** Emoncms\
**Created:** [13 April 2020 16:12 UTC](https://community.openenergymonitor.org/t/php-redis-not-recognised-by-php-solved/13851 "2020-04-13T16:12:57Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeff](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/j/e19b73/32.png) [@jeff](https://community.openenergymonitor.org/u/jeff)\
**Post date:** [13 April 2020 16:12 UTC](https://community.openenergymonitor.org/t/php-redis-not-recognised-by-php-solved/13851/1 "2020-04-13T16:12:57Z")

</div>

I was getting the following error message in emoncms:

`Process 'process__kwh_to_power' not available. Redis not installed.`

But redis is installed:

redis-server/stable,now 5:5.0.3-4+deb10u1  
php-redis/stable,now 4.2.0-1

And redis-cli --stat and redis-cli --bigkeys produce reasonable output.

I saw that redis was disabled in /var/www/emoncms/settings.php, but if I enable it, I get

` **Fatal error** : Uncaught Error: Class 'Redis' not found in /var/www/emoncms/index.php:34 Stack trace: #0 {main} thrown in **/var/www/emoncms/index.php** on line **34** `

I therefore assume that php is not finding php-redis.

Any clues how to fix this?

---

<div class="post-metadata">

**Author:** ![borpin](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/borpin/32/193_2.png) [@borpin](https://community.openenergymonitor.org/u/borpin)\
**Post date:** [13 April 2020 18:54 UTC](https://community.openenergymonitor.org/t/php-redis-not-recognised-by-php-solved/13851/2 "2020-04-13T18:54:52Z")

</div>

Hi Jeff, what is your system? emonPi or self install? Has it ever worked? if so, what has changed, an update to PHP for instance?

This is my [goto thread](https://community.openenergymonitor.org/t/install-dependencies/6530/19) on redis - there are actually 3 components installed and enabled. Beware, the install has changed since that thread!!!

You can see how REDIS is currently installed here [EmonScripts/redis.sh at master · openenergymonitor/EmonScripts · GitHub](https://github.com/openenergymonitor/EmonScripts/blob/master/install/redis.sh)

---

<div class="post-metadata">

**Author:** ![jeff](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/j/e19b73/32.png) [@jeff](https://community.openenergymonitor.org/u/jeff)\
**Post date:** [13 April 2020 20:05 UTC](https://community.openenergymonitor.org/t/php-redis-not-recognised-by-php-solved/13851/3 "2020-04-13T20:05:03Z")

</div>

Thanks for the swift reply. It is a self-install, which did work but probably not since I upgraded to Buster, or possibly, since a PHP upgrade.

I assume the reason for the problem is that emoncms is using php7.0, and the php-redis package in Buster only supports php7.3:

[https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=909111](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=909111)

[https://packages.debian.org/buster/amd64/php-redis/filelist](https://packages.debian.org/buster/amd64/php-redis/filelist)

I don’t like installing software past the package manager. I’ll have a go at creating a .deb with php7.0 support.

Or can I upgrade emoncms to php7.3?

---

<div class="post-metadata">

**Author:** ![borpin](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/borpin/32/193_2.png) [@borpin](https://community.openenergymonitor.org/u/borpin)\
**Post date:** [13 April 2020 20:07 UTC](https://community.openenergymonitor.org/t/php-redis-not-recognised-by-php-solved/13851/4 "2020-04-13T20:07:21Z")

</div>

If you look at the EmonScripts docs it supports an install on Debian.

Probably the phpenmod is not correct.

> [@jeff](#):
>
> I assume the reason for the problem is that emoncms is using php7.0

No it now uses 7.3 IIRC.

---

<div class="post-metadata">

**Author:** ![jeff](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/j/e19b73/32.png) [@jeff](https://community.openenergymonitor.org/u/jeff)\
**Post date:** [13 April 2020 20:30 UTC](https://community.openenergymonitor.org/t/php-redis-not-recognised-by-php-solved/13851/5 "2020-04-13T20:30:24Z")

</div>

> [@borpin](#):
>
> No it now uses 7.3 IIRC.

My machine has missed an update, then, as emoncms/admin/view shows:

> #### PHP
> 
> Version
> 
> 7.0.33-0+deb9u3 (Zend Version 3.0.0)

How do I get emoncms to use php7.3?

---

<div class="post-metadata">

**Author:** ![borpin](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/borpin/32/193_2.png) [@borpin](https://community.openenergymonitor.org/u/borpin)\
**Post date:** [13 April 2020 20:34 UTC](https://community.openenergymonitor.org/t/php-redis-not-recognised-by-php-solved/13851/6 "2020-04-13T20:34:05Z")

</div>

No, PHP is not updated as part of the emonCMS updates - it tends to break things. The new scripts take account of the PHP version installed when configuring it for emonCMS.

> [@jeff](#):
>
> not since I upgraded to Buster, or possibly, since a PHP upgrade.

The chances are upgrading to Buster in-situ probably broke the install. Do you still have 7.0 and 7.3 installed?

---

<div class="post-metadata">

**Author:** ![jeff](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/j/e19b73/32.png) [@jeff](https://community.openenergymonitor.org/u/jeff)\
**Post date:** [13 April 2020 20:55 UTC](https://community.openenergymonitor.org/t/php-redis-not-recognised-by-php-solved/13851/7 "2020-04-13T20:55:24Z")

</div>

> [@borpin](#):
>
> Do you still have 7.0 and 7.3 installed?

Yup. In parallel. Just removed all the php7.0 packages, installed libapache2-mod-php7.3, and emoncms suddenly is running with php7.3 🙂

And after enabling redis in settings.php, things are working! Thanks!

---

<div class="post-metadata">

**Author:** ![kazak](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/kazak/32/8801_2.png) [@kazak](https://community.openenergymonitor.org/u/kazak)\
**Post date:** [18 April 2020 10:27 UTC](https://community.openenergymonitor.org/t/php-redis-not-recognised-by-php-solved/13851/8 "2020-04-18T10:27:58Z")

</div>

I had same problem after an apt upgrade on buster.  
After checking /etc/php7.3/mods-available I found out, that redis.ini is missing, even php-redis is installed.  
On the opposite, everything looks fine in /etc/php7.4.

In apt history I can see redis-server and php-redis were updated together with many others php- packages.

So, I decided to switch from php7.3 to php7.4 for a try, and unloaded libapache2-mod-php7.3, then loaded libapache2-mod-php7.4.

Now everything looks fine 🙂 Later will uninstall php7.3 probably

BR  
Dimitar
