Couple of things to check
systemctl status redis.service
sudo apt-get install -y redis-server
Couple of things to check
systemctl status redis.service
sudo apt-get install -y redis-server
I executed both commands and presented this information below:
emoncms@emoncms:/var/www/emoncms$ sudo nano settings.php
emoncms@emoncms:/var/www/emoncms$ systemctl status redis.service
● redis-server.service - Advanced key-value store
Loaded: loaded (/lib/systemd/system/redis-server.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2019-09-13 16:10:17 -03; 12min ago
Docs: http://redis.io/documentation,
man:redis-server(1)
Main PID: 26344 (redis-server)
Tasks: 4 (limit: 2305)
CGroup: /system.slice/redis-server.service
└─26344 /usr/bin/redis-server 127.0.0.1:6379
Sep 13 16:10:17 emoncms systemd[1]: Stopped Advanced key-value store.
Sep 13 16:10:17 emoncms systemd[1]: Starting Advanced key-value store...
Sep 13 16:10:17 emoncms systemd[1]: redis-server.service: Can't open PID file /var/run/redis/redis-server.pid (yet?) after start: No such file or directory
Sep 13 16:10:17 emoncms systemd[1]: Started Advanced key-value store.
emoncms@emoncms:/var/www/emoncms$ sudo apt-get install -y redis-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
redis-server is already the newest version (5:4.0.9-1ubuntu0.2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
emoncms@emoncms:/var/www/emoncms$
Ok good so redis-server
is running.
Check this file…
cat /etc/php/7.2/mods-available/redis.ini
and
sudo pip install redis
Here is the output:
extension=redis.so
Requirement already satisfied: redis in /usr/local/lib/python2.7/dist-packages (3.3.8)
Have you rebooted?
Yes, apresenta o mesmo erro.
Some things to try;
Check the php-info
php -i | grep -i redis
From Installing emoncms - redis problem on openSUSE system - #27 by pb66 - the small script below will prove if PHP is able to connect to Redis on a basic level.
<?php
$redis = new Redis();
$redis->connect('127.0.0.1', 6379);
if ($redis->ping() === "+PONG") {
echo "Successfully connected to Redis!".PHP_EOL;
} else {
echo "Failed to get response from Redis!".PHP_EOL;
}
?>
Save the above code to a file called test_redis.php
and run from the command line
pb66@test2:~$ php test_redis.php
Successfully connected to Redis!
Final thing to check (if the above were unsuccessful) - from Installing emoncms - redis problem on openSUSE system - #4 by Greebo - test redis from the command line… Try this:
$ redis-cli
127.0.0.1:6379> lpush test "hello"
(integer) 1
127.0.0.1:6379> lpop test
"hello"
127.0.0.1:6379> exit
$
If that all works, we can confirm that redis is actually working and rule that out.
This is an odd one as it just worked for me.
Can you both post your latest “server info” for comparison?
brian@ubunt-emon:/var/www/emoncms$ sudo pip show redis | grep Version
Version: 3.3.8
which file path?
You can save it to where you wish - you created the file (see post no.56).
Here’s the output code
sudo php test_redis.php
PHP Warning: PHP Startup: Unable to load dynamic library ‘mosquitto.so’ (tried: /usr/lib/php/20170718/mosquitto.so (/usr/lib/php/20170718/mosquitto.so: cannot open shared object file: No such file or directory), /usr/lib/php/20170718/mosqu itto.so.so (/usr/lib/php/20170718/mosquitto.so.so: cannot open shared object fil e: No such file or directory)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘redis.so’ (tried: /us r/lib/php/20170718/redis.so (/usr/lib/php/20170718/redis.so: cannot open shared object file: No such file or directory), /usr/lib/php/20170718/redis.so.so (/usr /lib/php/20170718/redis.so.so: cannot open shared object file: No such file or d irectory)) in Unknown on line 0
PHP Fatal error: Uncaught Error: Class ‘Redis’ not found in /var/www/emoncms/te st_redis.php:2
Stack trace:
#0 {main}
thrown in /var/www/emoncms/test_redis.php on line 2
Can you post the output from this please?
Is this a clean & fresh Ubuntu installation or have you just upgraded?
Try without the sudo
.
I’ve renitialized the system and will install the script emoncms again, maybe the error is in ubuntu and not in emoncms.
error when running ./main.sh
ln: failed to create symbolic link ‘/var/www/emoncms/Modules/sync’: No such file or directory
ln: failed to create symbolic link ‘/var/www/emoncms/Modules/setup’: No such fil e or directory
Update Emoncms database
PHP Warning: chdir(): No such file or directory (errno 2) in /opt/openenergymon itor/EmonScripts/common/emoncmsdbupdate.php on line 8
PHP Warning: require(process_settings.php): failed to open stream: No such file or directory in /opt/openenergymonitor/EmonScripts/common/emoncmsdbupdate.php o n line 9
PHP Fatal error: require(): Failed opening required ‘process_settings.php’ (inc lude_path=’.:/usr/share/php’) in /opt/openenergymonitor/EmonScripts/common/emonc msdbupdate.php on line 9
emoncms@emoncms:/opt/openenergymonitor/EmonScripts/install$
I’m sorry, I really do not know what else to suggest.
I have now run the script multiple times on a fresh install of Ubuntu 18LTS (I reset the VM each time) and it just works apart from the few additional modifications I have outlined.
This looks like there are fundamental bits that have not installed correctly.
Do you have another version of emoncms that is stable?
It is not the software itself that is not stable, it is the mechanism to install it on systems other than Raspbian.
@TrystanLea is currently working on the scripts so they will be unstable at the moment. We are working on getting these right rather than trying to fix the documentation right now. Not ideal, but it is what it is.
Okay, thanks!