Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ChrisF79's avatar

Getting SSL error on new server

I just moved a Laravel 8 site of mine to a new Ubuntu 22.04 server from an old Ubuntu 18 server. Now, I'm getting this error when I go to my site:

file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:0A000126:SSL routines::unexpected eof while reading

I have PHP 8.1 installed and openssl is installed as well. In my phpinfo() I'm seeing this:

OpenSSL support => enabled
OpenSSL Library Version => OpenSSL 3.0.2 15 Mar 2022
OpenSSL Header Version => OpenSSL 3.0.2 15 Mar 2022
Openssl default config => /usr/lib/ssl/openssl.cnf

Directive => Local Value => Master Value
openssl.cafile => no value => no value
openssl.capath => no value => no value

I have no idea how to fix this and get my site to run. Any advice would be greatly appreciated!

0 likes
3 replies
ChrisF79's avatar

I had to convert my code from using file_get_contents to Curl.

josephnwy's avatar

If you are nginx server, update nginx to latest stable version will be solve.

Please or to participate in this conversation.