GithubHelp home page GithubHelp logo

Comments (9)

kporras07 avatar kporras07 commented on August 17, 2024

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.

hj-collab avatar hj-collab commented on August 17, 2024

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.

hj-collab avatar hj-collab commented on August 17, 2024

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.

hj-collab avatar hj-collab commented on August 17, 2024

@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.

kporras07 avatar kporras07 commented on August 17, 2024

@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.

tillkruss avatar tillkruss commented on August 17, 2024

Is there anything I can contribute here?

from wp-redis.

hj-collab avatar hj-collab commented on August 17, 2024

@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.

tillkruss avatar tillkruss commented on August 17, 2024

@hj-collab Using WP Redis or using Redis Object Cache?

from wp-redis.

hj-collab avatar hj-collab commented on August 17, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.