erikdubbelboer / phpredisadmin Goto Github PK
View Code? Open in Web Editor NEWSimple web interface to manage Redis databases.
Home Page: http://dubbelboer.com/phpRedisAdmin/
Simple web interface to manage Redis databases.
Home Page: http://dubbelboer.com/phpRedisAdmin/
Warning: require(*/redis/www/includes/../vendor/autoload.php): failed to open stream: No such file or directory in */redis/www/includes/common.inc.php on line 2
Fatal error: require(): Failed opening required '*/redis/www/includes/../vendor/autoload.php' (include_path='.:/usr/local/share/pear') in */redis/www/includes/common.inc.php on line 2
FreeBSD 9.1
Apache22
Php 5.4
Check installation command typo in Installing/Configuration chapter (see README.markdown file):
php composer.phar -s dev create-project erik-dubbelboer/php-redis-admin path/to/install
and fix it:
php composer.phar create-project -s dev erik-dubbelboer/php-redis-admin path/to/install
Thanks :)
open the url with nothing, help me please.
PHP version 5.3.18
Redis version 2.0.0
Fatal error: Uncaught exception 'Predis\ServerException' with message 'ERR unknown command 'OBJECT'' in D:\phpRedisAdmin\predis\lib\Predis\Network\StreamConnection.php:258 Stack trace: #0 D:\phpRedisAdmin\predis\lib\Predis\Network\ConnectionBase.php(142): Predis\Network\StreamConnection->read() #1 D:\phpRedisAdmin\predis\lib\Predis\Network\ConnectionBase.php(134): Predis\Network\ConnectionBase->readResponse(Object(Predis\Commands\ServerObject)) #2 D:\phpRedisAdmin\predis\lib\Predis\Client.php(219): Predis\Network\ConnectionBase->executeCommand(Object(Predis\Commands\ServerObject)) #3 D:\phpRedisAdmin\view.php(53): Predis\Client->__call('object', Array) #4 D:\phpRedisAdmin\view.php(53): Predis\Client->object('encoding', '90891xa') #5 {main} thrown in D:\phpRedisAdmin\predis\lib\Predis\Network\StreamConnection.php on line 258
I'm trying to get this to run for an AWS Elasticache Redis instance. I stumbled upon a couple of sources that report, that Elasticache doesn't allow the CONFIG command. Is there any way to get aroung this (even maybe with limited functionality) or will this not work with any Redis Admin UI?
in view.php:158
file
When we output the value, we use functions below
format_html($hkey, $server['charset'])
and in edit.php
use nothing
That will cause different muss when the server charset is not utf-8.
not only in edit.php
file's display logic , but also edit logic
I use binary serialization in redis.
It has the disadvantage that you need to handle more complex data than just strings but a number of serious advantages as well over using JSON and just making the string editable.
Advantages:
My work around for this is to make my encoder json -> igbinary and the decoder vice versa.
You could use the same solution with the serializer functions configurable (msgpack, igbinary, php, json, json pretty, etc).
This loses a key advantage of type preservation.
The catch 22 is that for the front end it would really want to be in JSON anyway so you still bump into those problems with PHP and indeterminate array type or JSON/JS and their charset issues. Though at the very least using a common JSON editing library would be nice.
On a side note, you have ?> at the end of files and then white space. This forces the use of output buffering even when it may not be necessary which increases memory usage a lot.
It is best to just not have the closing tag in include files even if you intend not to have a new line. Some tools like a new line at the end so people tend to add one as good practice. You cannot do this with ?> at the end of an include file without the ob.
Another side note, my json solution works well enough, though in your display you do not use white space pre.
Finally, I have some massive serialized objects but there is no way to effectively deal with these here.
It looks like early work but the first tool I've found where I am able to edit redis that is igbinary backed with relative easy and minimal setup cost.
Hi,
Can only access the first db(dbindex=0) or I made a mistake?
I'm getting these errors with latest phpRedisAdmin and predis:
[Thu Nov 29 21:43:32 2012] [error] [client 127.0.0.1] PHP Notice: Undefined index: used_memory in
/app/webservers/phpapp1/htdocs/phpRedisAdmin/overview.php on line 61, referer: http://127.0.0.1/phpRedisAdmin/?info&s=0
[Thu Nov 29 21:43:32 2012] [error] [client 127.0.0.1] PHP Notice: Undefined index: uptime_in_seconds in /app/webservers/phpapp1/htdocs/phpRedisAdmin/overview.php on line 63, referer: http://127.0.0.1/phpRedisAdmin/?info&s=0
[Thu Nov 29 21:52:30 2012] [error] [client 127.0.0.1] PHP Notice: Undefined index: redis_version in
/app/webservers/phpapp1/htdocs/phpRedisAdmin/overview.php on line 36, referer: http://127.0.0.1/phpRedisAdmin/?info&s=0
[Thu Nov 29 21:52:30 2012] [error] [client 127.0.0.1] PHP Notice: Undefined index: last_save_time in
/app/webservers/phpapp1/htdocs/phpRedisAdmin/overview.php on line 37, referer: http://127.0.0.1/phpRedisAdmin/?info&s=0
Looks like $redis->info isn't storing anything in $info.
However /phpRedisAdmin/?info&s=0 is able to display all values.
redis-2.6.4 32 bit
httpd-2.2.23 prefork mpm
php-5.4.8
rhel-5.5
I can't find the vendor/autoload.php file exist.
i`am using first database index 0 (DB 0) in Redis and second database index 1 (DB 1) in Redis
when i used phpRedisAdmin shows only keys into first database
Is there any way to display all databases which have keys on it ??
Fatal error: Uncaught exception 'Predis\Response\ServerException' with message 'ERR unknown command 'SCAN'' in /www/vendor/predis/predis/src/Client.php:367 Stack trace: #0 /www/phpRedisAdmin/vendor/predis/predis/src/Client.php(332): Predis\Client->onErrorResponse(Object(Predis\Command\KeyScan), Object(Predis\Response\Error)) #1 /www/phpRedisAdmin/vendor/predis/predis/src/Client.php(312): Predis\Client->executeCommand(Object(Predis\Command\KeyScan)) #2 /www/phpRedisAdmin/index.php(14): Predis\Client->__call('scan', Array) #3 /www/phpRedisAdmin/index.php(14): Predis\Client->scan(0, 'MATCH', '*', 'COUNT', 1000) #4 {main} thrown in /www/phpRedisAdmin/vendor/predis/predis/src/Client.php on line 367
like this '$redis = new Predis\Client('tcp://'.$server['host'].':'.$server['port']);' run window is error.
Hi, I just installed the phpRedisAdmin and something strange happened(not dig it yet. Just post it).
I use phpredis in my codebase, and these are what I have done:
$redis = new Redis();
$redis->pconnect(host,port);
$redis->set('aaa','bbb');
BUT, I cannot see the key(aaa) I just set in the admin console. (It's ok I use admin console to set something)
Filter fail on my 2 million keys redis db.
php require a 512 Mb RAM )))
I personalize filters, but my scopes is too large (( min 170 000 items.
index.php tried render whole records and crashed with timeout
Hi, great tool. That's number 1!
Our request is as follows:
Thanks, Sean
I see you write in the 'index.php':
// This is currently the only way to do this, this can be slow since we need to retrieve all keys
$len = count($redis->sMembers($fullkey));
Why don't you use 'scard' command, it directly get the number in the set.
Please create a pagination, because if have a many records, then PHP crashed. #19
This project depends on predis and points out the predis version. That's good. But on some Redis version, phpRedisAdmin doesn't work although the predis works. For example, my redis version is 2.4.10 on centos6.5, Predis 1.0.1 works fine but phpRedisAdmin doesn't work because redis 2.4.10 doesn't support 'SCAN' command.
[29-Jul-2014 09:23:23 Asia/Chongqing] PHP Warning: require(/home/binpang/code/php/phpRedisAdmin/includes/../vendor/autoload.php): failed to open stream: No such file or directory in /home/binpang/code/php/phpRedisAdmin/includes/common.inc.php on line 2
[29-Jul-2014 09:23:23 Asia/Chongqing] PHP Fatal error: require(): Failed opening required '/home/binpang/code/php/phpRedisAdmin/includes/../vendor/autoload.php' (include_path='.:/usr/local/php/lib/php') in /home/binpang/code/php/phpRedisAdmin/includes/common.inc.php on line 2
and I add autoload.php then I get:
[29-Jul-2014 09:25:14 Asia/Chongqing] PHP Fatal error: Class 'Predis\Client' not found in /home/binpang/code/php/phpRedisAdmin/includes/common.inc.php on line 95
if (isset($values) && ($count_elements_page !== false)) {
$values = array_slice($values, $count_elements_page * ($page_num_request - 1), $count_elements_page);
if (isset($values) && ($count_elements_page !== false)) {
$values = array_slice($values, $count_elements_page * ($page_num_request - 1), $count_elements_page,true);
}
key lose...
When the value is binary, view and edit is impossible.
thanks.
In /vendor/predis/predis/lib/Predis/Connection/ConnectionFactory.php
I found there is a bug in ConnectionFactory::create() method.
This bug may cause "Connection refuse exception" in Predis::Client() , because the ConnectionFactory::create() method will always use the paramters defined in ConnectionParameters::$defaults;
I made a small change to fix this bug ,see the screenshot blow:
That will works when we need to connect to another remote server by phpRedisAdmin.
I have a javascript error : Uncaught RangeError: Maximum call stack size exceeded
when I load a server with more than 60k keys in a subset
I think the javascript engine goes mad, the error pops out of jquery.js file
Hi, now the config requires
'name' => 'local db 2',
'host' => 'localhost',
'port' => 6379,
'db' => 1 // Optional database number
'filter' => 'something:*'
Our request is as follows
I hope you understand ;)
Thanks for the great work
this my config.inc.php
$config = array(
'servers' => array(
array(
'name' => 'troy', // Optional name.
'host' => '192.168.113.141',
'port' => 6379,
'filter' => '*',
but i can use redis-cli to connect
when I delete keys ,it show me that ! How to fix it? thanks.
error in chrome console:
Uncaught SecurityError: Failed to execute 'replaceState' on 'History': A history state object with URL xxx
error in firefox console:
SecurityError: The operation is insecure.
[root@yhidc php]# bin/php composer.phar -s dev create-project erik-dubbelboer/php-redis-admin /app/nginx/html/
[InvalidArgumentException]
Command "dev" is not defined.
Did you mean this?
depends
I've no idea about this error, PLEASE help me, TKS1
error msg :ERR unknown command 'SCAN' in D:\web\phpRedisAdmin\vendor\predis\predis\src\Client.php on line 367
maybe need some modify, For example, in the index.php file of the 7 lines to 27 lines ,Special treatment for the old version, use redis's keys command replace scan command
like's
if (!empty($server['keys'])) {
$keys = $redis->keys($server['filter']);
} else {
$next = 0;
$keys = array();
while (true) {
if(isset($_GET['mode']) && $_GET['mode'] == 'old') {
$keys = $redis->keys('*');
break;
} else {
$r = $redis->scan($next, 'MATCH', $server['filter'], 'COUNT', $server['scansize']);
$next = $r[0];
$keys = array_merge($keys, $r[1]);
if ($next == 0) {
break;
}
}
}
}
of cause, It's just a suggestion, not perfect.
includes/common.inc.php:
86c86
< $redis = new Predis\Client('tcp://'.$server['host'].':'.$server['port']);
---
> $redis = (!$server['port']) ? new Predis\Client($server['host']) : new Predis\Client('tcp://'.$server['host'].':'.$server['port']);
PHP Notice: Undefined index: databases in /home/website/phpredisadmin/index.php on line 180
As I debug into the index.php, I found:
I' m sort of newbie. That's probably why I have not found how to protect access to the directory where phpRedisAdmin is installed.
My attempts to place "AuthType Basic"-like protection in a local .htaccess or in Apache2 conf files have all failed miserably (yes, I have restarted Apache)
I'm ok to draft some sort of doc for that... if/when I know how to do it
Hello, I am having trouble in using the phpredisadmin with ElastiCache on Amazon Web Service, when setting the redis have the following error:
2015/10/08 19:27:54 [error] 28723#0: *23262 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught exception 'Predis\Response\ServerException' with message 'ERR unknown command 'CONFIG'' in /srv/www/htdocs/default/phpRedisAdmin/vendor/src/Client.php:365
Stack trace:
#0 /srv/www/htdocs/default/phpRedisAdmin/vendor/src/Client.php(330): Predis\Client->onErrorResponse(Object(Predis\Command\ServerConfig), Object(Predis\Response\Error))
#1 /srv/www/htdocs/default/phpRedisAdmin/vendor/src/Client.php(310): Predis\Client->executeCommand(Object(Predis\Command\ServerConfig))
#2 /srv/www/htdocs/default/phpRedisAdmin/index.php(176): Predis\Client->__call('config', Array)
#3 /srv/www/htdocs/default/phpRedisAdmin/index.php(176): Predis\Client->config('GET', 'databases')
#4 {main}
thrown in /srv/www/htdocs/default/phpRedisAdmin/vendor/src/Client.php on line 365" while reading response header from upstream, client: 189.7.9.21, server: default, request: "GET /phpRedisAdmin/?info&s=1&d=5 HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "IP", referrer: "http://IP/phpRedisAdmin/?info&s=0&d=5"
This should work or is there some kind of restriction?
thanks in advance
Sometimes I'm looking at a specific set of keys, e.g. 'failed' below, and I want to refresh/update the values within they key without refreshing the whole page.
Would it be possible to have a refresh button next to the key name and ajax them in? Or assign an anchor tag to each key, and have the refresh button refresh the page but jump down to the anchor you clicked and auto-expand the node?
(This is really just an ease-of-use suggestion; otherwise I am finding this to be a really handy tool)
Redis does not handle combination of filters, but this can be done easily with phpRedisAdmin. I mean that I have large amount of data, like > 100k of keys. But I work only with several. I can set filter to "mydatakey" and it works. But if I want to display in one place "mydatakey" and "mydatakey2" or even "mydatakey3" it's not possible, I clone phpRedisAdmin with different filters. Is it possible to add multiple filters for one server in config?
file:ttl.php
line:12
"$redis->setTimeout($_POST['key'], $_POST['ttl']);" is wrong, should change to:
"$redis->expire($_POST['key'], $_POST['ttl']);"
After a few redis-benchmarks with
redis-benchmark -h 127.0.0.1 -p 6379 -r 1000000 -n 2000000 -t get,set,lpush,lpop -P 16 -q
going to my installed php redis admin page in web browser just ends up spinning with loading icon then ends with a blank page ?
redis-cli -h 127.0.0.1 -p 6379 info
# Server
redis_version:3.0.4
redis_git_sha1:00000000
redis_git_dirty:0
redis_build_id:f984dc706585cedc
redis_mode:standalone
os:Linux 3.10.0-229.11.1.el7.x86_64 x86_64
arch_bits:64
multiplexing_api:epoll
gcc_version:4.8.3
process_id:20643
run_id:c46d3ff66cde5f945141a75bbf615c0688663ec5
tcp_port:6379
uptime_in_seconds:2414
uptime_in_days:0
hz:10
lru_clock:528437
config_file:/etc/redis.conf
# Clients
connected_clients:1
client_longest_output_list:0
client_biggest_input_buf:0
blocked_clients:0
# Memory
used_memory:95881312
used_memory_human:91.44M
used_memory_rss:110108672
used_memory_peak:222726984
used_memory_peak_human:212.41M
used_memory_lua:36864
mem_fragmentation_ratio:1.15
mem_allocator:jemalloc-3.6.0
# Persistence
loading:0
rdb_changes_since_last_save:0
rdb_bgsave_in_progress:0
rdb_last_save_time:1443367663
rdb_last_bgsave_status:ok
rdb_last_bgsave_time_sec:1
rdb_current_bgsave_time_sec:-1
aof_enabled:1
aof_rewrite_in_progress:0
aof_rewrite_scheduled:0
aof_last_rewrite_time_sec:2
aof_current_rewrite_time_sec:-1
aof_last_bgrewrite_status:ok
aof_last_write_status:ok
aof_current_size:111473175
aof_base_size:55750096
aof_pending_rewrite:0
aof_buffer_length:0
aof_rewrite_buffer_length:0
aof_pending_bio_fsync:0
aof_delayed_fsync:0
# Stats
total_connections_received:272
total_commands_processed:9330917
instantaneous_ops_per_sec:0
total_net_input_bytes:333826251
total_net_output_bytes:450040084
instantaneous_input_kbps:0.00
instantaneous_output_kbps:0.00
rejected_connections:0
sync_full:0
sync_partial_ok:0
sync_partial_err:0
expired_keys:0
evicted_keys:0
keyspace_hits:2042823
keyspace_misses:303881
pubsub_channels:0
pubsub_patterns:0
latest_fork_usec:3321
migrate_cached_sockets:0
# Replication
role:master
connected_slaves:0
master_repl_offset:0
repl_backlog_active:0
repl_backlog_size:1048576
repl_backlog_first_byte_offset:0
repl_backlog_histlen:0
# CPU
used_cpu_sys:13.38
used_cpu_user:71.54
used_cpu_sys_children:0.71
used_cpu_user_children:3.25
# Cluster
cluster_enabled:0
# Keyspace
db0:keys=902823,expires=0,avg_ttl=0
installed the application but keep getting an error, "error] [client ::1] PHP Fatal error: Call to undefined function mb_internal_encoding() in /username/phpRedisAdmin/includes/common.inc.php line xx" message in my error log.
my config.inc.php reads
where am i getting this wrong?
The display page can be paginated when using some data structures like List, Hash or Sorted Set.
Sorry, man, but sometimes portion of criticism is necessary to start moving forward.
This code looks like homework of newbie in php. Did you hear about separation of code and presentation? MVC? OOP? Unit-tests? Autoloaders?
I hope you will take care of it :)
I hoping to support msgpack value format display
Fatal error: Uncaught exception 'Predis\Response\ServerException' with message 'ERR unknown command 'SCAN'' in /var/www/phpRedisAdmin/vendor/src/Client.php:367 Stack trace: #0 /var/www/phpRedisAdmin/vendor/src/Client.php(332): Predis\Client->onErrorResponse(Object(Predis\Command\KeyScan), Object(Predis\Response\Error)) #1 /var/www/phpRedisAdmin/vendor/src/Client.php(312): Predis\Client->executeCommand(Object(Predis\Command\KeyScan)) #2 /var/www/phpRedisAdmin/index.php(14): Predis\Client->__call('scan', Array) #3 /var/www/phpRedisAdmin/index.php(14): Predis\Client->scan(0, 'MATCH', '*', 'COUNT', 1000) #4 {main} thrown in /var/www/phpRedisAdmin/vendor/src/Client.php on line 367
Hello Erik and thank you for your work.
I'm here to explain how to install phpRedisAdmin through composer.json, as I feel more comfortable listing my dependencies there. It's simple but as I'm not familiar with Composer, it took me a little time to figure out and I thought I'd share my experience. Feel free to hint at it in your documentation if you will :)
Since Composer by default doesn't let you install your projects in custom places (typically we need to install phpRedisAdmin in a /public/admin/
folder rather than the typical /vendor
), you need to specify a custom installer in your composer.json, and the "installer-paths" Composer feature will then work with phpRedisAdmin. I found one by @mnsami that does just that.
So here's the code you put in your composer.json file :
{
"extra": {
"installer-paths": {
"public/admin/phpredisadmin": ["erik-dubbelboer/php-redis-admin"]
}
},
"require": {
"mnsami/composer-custom-directory-installer": "1.0.*",
"erik-dubbelboer/php-redis-admin": "1.4.0"
}
}
When it's done, install the files with composer install
or composer update
.
It's not finished yet, as you'll get something like this when running the app :
Fatal error: require(): Failed opening required 'var/www/public/admin/phpredisadmin/includes/../vendor/autoload.php' (include_path='.:/usr/local/share/pear') in *var/www/public/admin/phpredisadmin/includes/common.inc.php on line 2
.
You just need to create a symlink in public/admin/phpredisadmin
named autoload.php
that will point to your composer autoloader, typically vendor/autoload.php
. Under Linux, that would be something like :
mkdir /var/www/public/admin/phpredisadmin/vendor
ln -s /var/www/vendor/autoload.php /var/www/public/admin/phpredisadmin/vendor/autoload.php
Simple as that ! Good luck :)
in edit.php, I found a nl2br, remove it and now it works.
change the following line
to
Hi please help me with this. It's quite urgent.
For some reason, I can no longer edit keys with phpRedisAdmin. I log in fine with my usual credentials , however I come to edit a key, it brings the login prompt again and if I enter my usual credentials again, it doesn't work.
It's like my admin account has turned into read-only mode. Is this even possible?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.