Community
OpenEnergyMonitor

Community

RaspberyPi php5-redis version

Tags: #<Tag:0x00007f6e01fe8190> #<Tag:0x00007f6e01fe80a0> #<Tag:0x00007f6e034f3f58> #<Tag:0x00007f6e034f3e90>

I’m updating my system which is based upon the February 2016 Beta Image, and back then there was a PHP5-redis version issue that prevented new feeds from being created. https://openenergymonitor.org/emon/node/12146
When I updated my first Pi it asked me which version of php I wanted, and as that Pi no longer runs EMONCMS I told it to use the package maintainers version.
Is this the version to use on the EMONCMS machine,or do I need to keep my existing version to ensure everything works?
Unfortunately I have too many other things running on the machines to simply replace the image so I’m trying to bring it up to the latest version the hard way.

See the notes from the image build guide:

Note: at time of writing the version of php5-redis included in the Raspbian Jessie sources (2.2.5-1) caused Apache to crash (segmentation errrors in Apache error log). Installing the latest stable version (2.2.7) of php5-redis from github fixed the issue. This step probably won’t be required in the future when the updated version of php5-redis makes it’s way into the sources. To check the version in the sources: sudo apt-cache show php5-redis

git clone --branch 2.2.7 https://github.com/phpredis/phpredis
cd phpredis
(check the version we are about to install:)
​cat php_redis.h | grep VERSION
phpize
./configure 
sudo make 
sudo make install

I have just checked and the above still applies since the version of php5-redis in the Jessie packages is STILL 2.2.5-1 :frowning:

[email protected]:~ $ sudo apt-cache show php5-redis

Package: php5-redis
Source: php-redis
Version: 2.2.5-1
Architecture: armhf
Maintainer: Debian PHP PECL Maintainers <[email protected]>
Installed-Size: 248
Depends: libc6 (>= 2.4), phpapi-20131226, php5-common (>= 5.2.0), php5-common (<< 6.0.0)
Suggests: redis-server
Homepage: http://pecl.php.net/package/redis
Priority: optional
Section: php
Filename: pool/main/p/php-redis/php5-redis_2.2.5-1_armhf.deb

You will need to install 2.2.7 (later will also work…probably! Latest stable is now V3.0.0) manually as detailed above.

1 Like

Thanks very much for the reply, I’ll try keeping the version I have and after testing all is well, update to V3.0.0 afterwards. I image before doing stuff like this so a backward step is easily taken if it goes wrong.

Let me know how you get on with php5-redis 3.0.0. We’re still rocking 2.2.7, seems stable.

1 Like

Will do, it will be a few days however as the updates have broken Samba when the Pi is in readonly mode, and I need to work out which set of hoops need to be jumped through this time around to make it work. Googling suggests I’m the only person who uses it this way sadly.
Update: I’ve fixed this by adding a ramdrive at /var/cache/samba
Will run it for a few days before updating my Main emoncms machine and testing php redis

I’ve just updated the OS on my main machine and after telling it I want to keep my current version of PHP Redis all is well,
Whats the syntax to get the latest version of PHP Redis? (V3.0.0)
I’m happy to test it for you after taking an image backup, but Is it easiest to leave alone what isn’t broken?

Great! I think this should work:

git clone --branch 3.0.0 https://github.com/phpredis/phpredis
cd phpredis

Double check the version we are about to install:

cat php_redis.h | grep VERSION

Install:

phpize
./configure
sudo make
sudo make install

Should you be using php-redis v3 with php <v7?

phpredis 3.0.0

This version of phpredis supports cluster and is intended for php versions
7.0.0 and higher. To compile cluster-enabled phpredis for older versions
of php, please use the 2.2.8 pecl package.

phpredis 2.2.8

The main improvement in this version of phpredis is support for Redis
Cluster. This version of phpredis is intended for versions of php older
than 7.

Taken from the PECL changelog for php-redis

The Github repo readme doesn’t look up to date as it makes no mention of PHPv7 only PHPv5. But the release tag dates do show that v2.8 “for <v7” was released after v3rc1.

Good point, Emoncms will not (yet) work with php 7 therefore. It looks like we should stick with php5-redis 2.2.7. An update to 2.2.8 looks possible but looks like it won’t bring much benefit looking at the change log.

That works for me!
To finalise this thread, I updated the OS on my main machine after changing FSTAB, and adding /var/cache/samba as TMPFS. I then updated the EMONPI image using the web interface, and when nothing seemed to happen to EMONCMS I changed to its folder and called GIT PULL which has updated it to V9.7.7 although I can’t see anything different from the version I had before.
Happily everything seems to work including Samba in Read Only Mode

1 Like

Sorry, what worked? Please confirm

Mmm strange why emonpi update did not work. Are you running a pre-built image or have you built yourself?

To update emoncms fully you will also need to git pull all the modules as the update script does:

Here is the emoncms core change log: https://github.com/emoncms/emoncms/releases
By default emonSD / emonPi is set to the emoncms stable branch wich usually lags the master branch by few weeks.

Most of the dev recently has been on the dashboard module.

Leaving it alone on V2.2.7 from the build guide works fo me :slight_smile:
I’m running an image I built myself. Basically followed the build guide from back in February but left out the LCD / NodeRed / OpenHAB. I run OpenHAB from its own folder in the data partition, as it was already a working system in this way before it was added to the image.
The script you posted is a lot more extensive than mine, I’ll image the SD Card, then update the script before running it again.

1 Like

The new script seems to have done the trick, many things changed now!
Cheers

1 Like