title: Laravel Redis - artisan cache:clear - Connection refused [unix:/path/.redis/redis.sock]
body: <p> I have configured Redis (using a socket) in the Laravel in my hosting server. Everything works fine (I have tested reading from cache, sessions etc.), I have one database for a cache and a second one for users sessions.<br>
   However, when I run &quot;php artisan cache:clear&quot; it shows the error:<br>
  &quot;In AbstractConnection.php line 155: Connection refused [unix:/path/.redis/redis.sock]&quot;.<br>
  This error also occures when I run any command which uses Redis, for example &quot;php73 artisan cron:updateForeignPrices&quot;.<br>
  <br>
  <strong>.env</strong></p>
  <pre><code>CACHE_DRIVER=redis
  SESSION_DRIVER=redis
  
  REDIS_HOST=/path/.redis/redis.sock
  REDIS_PASSWORD=null
  REDIS_PORT=0
  REDIS_CACHE_DB=0
  REDIS_SESSION_DB=1
  </code></pre>
  <p><strong>config/database.php</strong></p>
  <pre><code>'redis' =&gt; [
      'client' =&gt; env('REDIS_CLIENT', 'predis'),
      'cluster' =&gt; true,
  
      'options' =&gt; [
          'cluster' =&gt; env('REDIS_CLUSTER', 'predis'),
          'prefix' =&gt; Str::slug(env('APP_NAME'), '_').'_',
          'parameters' =&gt; ['password' =&gt; env('REDIS_PASSWORD', null)],
      ],
  
      'default' =&gt; [
          'scheme' =&gt; 'unix',
          'path' =&gt; env('REDIS_HOST'),
          'host' =&gt; env('REDIS_HOST'),
          'password' =&gt; env('REDIS_PASSWORD'),
          'port' =&gt; env('REDIS_PORT'),
          'database' =&gt; env('REDIS_CACHE_DB', 0)
      ],
  
      'cache' =&gt; [
          'scheme' =&gt; 'unix',
          'path' =&gt; env('REDIS_HOST'),
          'host' =&gt; env('REDIS_HOST'),
          'password' =&gt; env('REDIS_PASSWORD'),
          'port' =&gt; env('REDIS_PORT'),
          'database' =&gt; env('REDIS_CACHE_DB', 0),
      ],
  
      'session' =&gt; [
          'scheme' =&gt; 'unix',
          'path' =&gt; env('REDIS_HOST'),
          'host' =&gt; env('REDIS_HOST'),
          'password' =&gt; env('REDIS_PASSWORD'),
          'port' =&gt; env('REDIS_PORT'),
          'database' =&gt; env('REDIS_SESSION_DB', 1),
      ]
  ]
  </code></pre>
  <p><strong>Hosting provider's info about Redis (translated):</strong><br>
  Socket: /path-to-my-directory/.redis/redis.sock<br>
  User and password: (none)<br>
  Port: 0<br>
  RAM: 128 MB<br>
  Instruction on WordPress Litespeed:<br></p>
  <ol>
  <li>In the „Host” field paste address from the panel, for example: /home/klient.dhosting.pl/dhtutorial/.redis/redis.sock
  <br></li>
  <li>In the „Port” field remove a default value and type &quot;0&quot;.
  <br></li>
  <li>Leave &quot;user&quot; and &quot;password&quot; empty.<br></li>
  </ol>
  <p> It seems like everything works correctly in a direct use of Redis, but not via console. Anyone has an idea how to fix it?
  <br>
  Thanks in advance, I have searched whole Internet.</p>