Hope someone can help with this as a new install of PHP and Heroku Redis
This is the error I'm getting:- 2020-12-14T19:46:37.368544+00:00 app[web.1]: [14-Dec-2020 19:46:37 UTC] PHP Warning: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages: 2020-12-14T19:46:37.368963+00:00 app[web.1]: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed in /app/vendor/predis/predis/src/Connection/StreamConnection.php on line 246 2020-12-14T19:46:37.369133+00:00 heroku[router]: at=info method=GET path="/v1/index.php" host=settingsapi.gtmforshopify.com request_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 Fatal error: Uncaught Predis\Connection\ConnectionException: Error while switching to encrypted communication [rediss://ec2-23-21-210-25.compute-1.amazonaws.com:13579] in /app/vendor/predis/predis/src/Connection/AbstractConnection.php:155 2020-12-14T19:46:37.369716+00:00 app[web.1]: Stack trace: 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 app[web.1]: #5 /app/vendor/predis/predis/src/Connection/StreamConnection.php(288): Predis\Connection\AbstractConnection->getResource() 2020-12-14T19:46:37.377659+00:00 app[web.1]: #6 /app/vendor/predis/predis/src/Connect in /app/vendor/predis/predis/src/Connection/AbstractConnection.php on line 155
This is the code I'm 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);
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.
PHP (from the English Hypertext Preprocessor - hypertext preprocessor) is a scripting programming language for developing web applications. Supported by most hosting providers, it is one of the most popular tools for creating dynamic websites.
The PHP scripting language has gained wide popularity due to its processing speed, simplicity, cross-platform, functionality and distribution of source codes under its own license.
https://www.php.net/
Welcome to the Q&A site for web developers. Here you can ask a question about the problem you are facing and get answers from other experts. We have created a user-friendly interface so that you can quickly and free of charge ask a question about a web programming problem. We also invite other experts to join our community and help other members who ask questions. In addition, you can use our search for questions with a solution.
Ask about the real problem you are facing. Describe in detail what you are doing and what you want to achieve.
Our goal is to create a strong community in which everyone will support each other. If you find a question and know the answer to it, help others with your knowledge.