Comments (9)
Hi!
Thanks for reporting this.
Could you please provide steps to reproduce? (i.e. how is your redis setup and host configuration, what do you do to get the warning, etc)
Thanks!
from wp-redis.
Hi,
Thanks for getting back to me. I am using the default Redis configuration with unix socket instead of tcp. The only change I made is in the php.ini file, where I have set an opendir_base redirection.
open_basedir = /var/www/html/
PHP files won't execute outside of this directory as per this restriction set. I am not facing the same issue with the Redis Cache plugin available at https://wordpress.org/plugins/redis-cache/.
Best regards,
from wp-redis.
Hi Kevin,
I have implemented a temporary solution to enable PHP files to access the Redis Unix socket. However, I am not satisfied with this approach as I believe it compromises security. Could you please review @tillkruss object cache file (https://github.com/rhubarbgroup/redis-cache/blob/develop/includes/object-cache.php) and observe how he manages to access the Unix socket without requiring any bypass to the open_basedir protection?
Temporary solution:
php_value[open_basedir] = /var/www/html/:/var/run/redis/
from wp-redis.
@kporras07 The issue is solved if, instead of looking for the file, we look for the Unix socket.
Current:
if ( file_exists( $redis_server['host'] ) && 'socket' === filetype( $redis_server['host'] ) ) { // unix socket connection.
Suggested:
if (strpos($redis_server['host'], 'unix:///') === 0) { // Unix socket connection.
Then defining the following in the wp-config.php file
// Redis
$redis_server = array(
'host' => 'unix:///var/run/redis/redis.sock',
'port' => null,
);
What do you think?
from wp-redis.
@hj-collab thanks! That's a lot of useful info. I created an internal ticket and will be adding this info there and pass this along to the team that works on this plugin.
Internal ticket: BUGS-6318
Thanks!
from wp-redis.
Is there anything I can contribute here?
from wp-redis.
@kporras07 Thanks Kevin!
@tillkruss Can you please check if my suggested solution is the way to go? Because it won't work unless they specify unix:/// in the file path for socket. Pantheon will have to update the documentation to reflect the same.
// Redis
$redis_server = array(
'host' => 'unix:///var/run/redis/redis.sock',
'port' => null,
);
from wp-redis.
@hj-collab Using WP Redis or using Redis Object Cache?
from wp-redis.
@tillkruss I am using WP Redis.
@pwtyler I noticed that you pushed the pull request related to this issue. You will also need to update the documentation to use a sock URL with unix:/// in it. It won't work otherwise.
from wp-redis.
Related Issues (20)
- Implement `wp_cache_supports` function HOT 2
- many php warnings in my logs HOT 2
- CircleCI is not configured correctly HOT 4
- When `$wp_object_cache->is_redis_connected` is `false` there is a fatal error for `$missing_redis_message` HOT 4
- [BUGS-5944] Command "wp redis cli" fails HOT 1
- Fix some docblocks
- [BUGS-6118] PHP Deprecation notice on passing port = null @ Redis::connect() HOT 5
- As of WordPress 6.1 A Notice About Incorrect Support for `wp_cache_flush_runtime` HOT 8
- Re-add wordpress-upstream-tests to behat tests
- Fatal error in WP-CLI when accessing cache HOT 3
- esc_html is not safe to use (exception loop) HOT 3
- Implement PHPUnit and/or Behat tests for WP-CLI
- PHP 8.2 compatibility HOT 1
- [CMSP-467] Please don't strip all tags from the cache password. HOT 2
- [CMSP-470] Replace use of wp_strip_all_tags (possibly any wp filter function?) in object-cache.php
- Changes Merged from #360 Break Redis Connections on Pantheon Due to #400 and Incorrect array_replace_recursive call
- Large response size HOT 2
- [BUGS-6457] Warning when using tls protocol HOT 3
- PHP 8.1 deprecated warning
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wp-redis.