使用predis将heroku php堆栈连接到redis的问题

a2mppw5e  于 2021-06-07  发布在  Redis
关注(0)|答案(0)|浏览(372)

希望有人能帮助这作为一个新安装的php和heroku redis
这就是我犯的错误getting:- 2020-12-14t19:46:37.368544+00:00应用程序[web.1]:[2020年12月14日19:46:37 utc]php警告:stream\u socket\u enable\u crypto():ssl操作失败,代码为1。openssl错误消息:2020-12-14t19:46:37.368963+00:00应用程序[web.1]:error:1416f086:sslroutines:tls_process_server_certificate:第246 2020-12-14t19:46:37.369133+00:00 heroku[router]:at=info method=get path=“/v1/index.php”行的/app/vendor/predis/predis/src/connection/streamconnection.php中的证书验证失败host=settingsapi.gtmforshopfify.com请求\u id=b37a7e35-6813-4b57-98bc-96bcc9f0da20 fwd=“82.69.152.94”dyno=web.1 connect=0ms service=53ms status=500 bytes=201 protocol=https 2020-12-14t19:46:37.369618+00:00 app[web.1]:[14-dec-2020 19:46:37 utc]php致命错误:uncaught predis\connection\connectionexception:切换到加密时出错沟通[rediss://ec2-23-21-210-25.compute-1.amazonaws.com:13579]在/app/vendor/predis/predis/src/connection/abstractconnection中。php:155 2020-12-14t19:46:37.369716+00:00 app[web.1]:堆栈跟踪:2020-12-14t19:46:37.370064+00:00 app[web.1]:#0/app/vendor/predis/predis/src/connection/streamconnection.php(247):predis\connection\abstractconnection->onconnectionerror()2020-12-14t19:46:37.370396+00:00 app[web.1]:#1/app/vendor/predis/predis/src/connection/streamconnection.php(107):predis\connection\streamconnection->tlsstreaminitializer()2020-12-14t19:46:37.370723+00:00 app[web.1]:#2/app/vendor/predis/predis/src/connection/abstractconnection.php(81):predis\connection\streamconnection->createresource()2020-12-14t19:46:37.376422+00:00 app[web.1]:#3/app/vendor/predis/predis/src/connection/streamconnection.php(258):predis\connection\abstractconnection->connect()2020-12-14t19:46:37.376880+00:00 app[web.1]:#4/app/vendor/predis/predis/src/connection/abstractconnection.php(180):predis\connection\streamconnection->connect()2020-12-14t19:46:37.377341+00:00应用程序[web.1]:#5/app/vendor/predis/predis/src/connection/streamconnection.php(288):predis\connection\abstractconnection->getresource()2020-12-14t19:46:37.377659+00:00应用程序[web.1]:#6/app/vendor/predis/predis/src/connect-in/app/vendor/predis/predis/src/connection/abstractconnection.php第155行
这是我的密码using:-

Predis\Autoloader::register();

if (getenv('REDIS_URL')) {
    $url = parse_url(getenv('REDIS_URL'));

    putenv('REDIS_HOST='.$url['host']);
    putenv('REDIS_PORT='.$url['port']);
    putenv('REDIS_PASSWORD='.$url['pass']);
    putenv('REDIS_SCHEME='.$url['scheme']);
}

$options = [];
$options['ssl']['allow_self_signed'] = TRUE;
$options['ssl']['verify_peer'] = FALSE;
$options['ssl']['verify_peer_name'] = FALSE;

$redis = new Predis\Client([
    'scheme'   => getenv('REDIS_SCHEME'),
    'host'   => getenv('REDIS_HOST'),
    'port'   => getenv('REDIS_PORT'),
    'password'   => getenv('REDIS_PASSWORD'),
    'database' => 0,
], $options);

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题