I moved my Laravel 5.5 application to another server - I use exactly the same code there (did a git clone
) with exactly the same composer.json
and composer.lock
files (even the NGINX
configuration is the same).
When I run my application I get the following error:
Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_ERROR)
Call to undefined method Illuminate\Support\Facades\Redis::connect()
Here is the code:
namespace App\Http\Controllers;
use Illuminate\Http\Request;
...
public function somefunction() {
$redis = new \Redis();
$redis->connect(env('REDIS_HOST')); <-------------
...
The composer package predis/predis
is installed and I have no php-redis
on my system.
On both systems (debian) redis is installed and runs on 127.0.0.1
. Both systems use the same configuration in .env
and in config/*
:
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
The only thing, which is different is, that on one system (old one) I'm runnning php7.0
and on the new system I run php7.3
- I switched to php7.0
on the new system to check if that's the error, but I still get the exception.
Once again - on my other server everything is running fine with exactly the same code, which frustrates me - I can't figure out why this is happening.