Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

osx 13.2 - M1 - OpenSSL library could not be loaded, make sure OpenSSL 1.0, 1.1, or 3.0 is installed #1446

Open
Ravenna opened this issue Mar 2, 2023 · 7 comments

Comments

@Ravenna
Copy link

Ravenna commented Mar 2, 2023

PHP version
php -v: PHP 8.2.3 (cli) (built: Feb 15 2023 00:18:01) (NTS)
which PHP: /opt/homebrew/bin/php

PHP SQLSRV or PDO_SQLSRV version
Pecl list:
Installed packages, channel pecl.php.net:

Package Version State
imagick 3.7.0 stable
pdo_sqlsrv 5.10.1 stable
sqlsrv 5.10.1 stable

Microsoft ODBC Driver version
ODBC Driver for Microsoft(R) SQL Server(R)
https://msdn.microsoft.com/en-us/library/mt654048(v=sql.1).aspx
/opt/homebrew/Cellar/msodbcsql18/18.2.1.1 (10 files, 1.9MB) *
Built from source on 2023-03-02 at 13:04:24

SQL Server version
17

Problem description
I have installed PHP, and followed: https://github.com/microsoft/msphpsql/blob/master/Linux-mac-install.md#installing-the-drivers-on-macos for installing the tools and drivers.

IT sounds like I should be using openssl 1.1 so I have that installed:
which openssl - /opt/homebrew/opt/openssl@1.1/bin/openssl
openssl version - OpenSSL 1.1.1t 7 Feb 2023

I setup a simple connection PHP file to test this out based on notes from the docs and others:

` $serverName = "{IP ADDRESS},{PORT NUMBER}";
$connectionOptions = array(
"Database" => "Wcb_301",
"Uid" => "{USERNAME}",
"PWD" => "{PASSWORD}"
);

$conn = sqlsrv_connect($serverName, $connectionOptions);

if( $conn ) {
 echo "Connection established.<br />";

}else{
echo "Connection could not be established.
";
die( print_r( sqlsrv_errors(), true));
}`

The result is:
`Connection could not be established.
Array
(
[0] => Array
(
[0] => 08001
[SQLSTATE] => 08001
[1] => -1
[code] => -1
[2] => [Microsoft][ODBC Driver 18 for SQL Server]SSL Provider: [OpenSSL library could not be loaded, make sure
OpenSSL 1.0, 1.1, or 3.0 is installed]
[message] => [Microsoft][ODBC Driver 18 for SQL Server]SSL Provider: [OpenSSL library could not be loaded,
make sure OpenSSL 1.0, 1.1, or 3.0 is installed]
)

[1] => Array
    (
        [0] => 08001
        [SQLSTATE] => 08001
        [1] => -1
        [code] => -1
        [2] => [Microsoft][ODBC Driver 18 for SQL Server]Client unable to establish connection
        [message] => [Microsoft][ODBC Driver 18 for SQL Server]Client unable to establish connection
    )

`

I even tracked through: #1319 to see if that would help. No dice.
Does anyone have any idea how to fix the problem or further debug it?

@absci
Copy link
Contributor

absci commented Mar 2, 2023

Could you try to run this script?

rm -f /usr/local/opt/openssl 
ln -s /usr/local/opt/openssl@1.1 /usr/local/opt/openssl

ls -ld /usr/local/opt/openssl*

@Ravenna
Copy link
Author

Ravenna commented Mar 2, 2023

@absci I am on an M1 so the paths are different. #1319 had similar recommendations but those did not solve it for me.

@v-chojas
Copy link

v-chojas commented Mar 6, 2023

Is /opt/homebrew/opt/openssl/lib/ present? Because that's where the ARM64 driver looks for OpenSSL.

@Ravenna
Copy link
Author

Ravenna commented Mar 6, 2023

@v-chojas
Screenshot 2023-03-06 at 10 20 44 AM

If I run the command like shown above I get:

`tjsherrill@Tjs-MacBook-Pro ~ % ln -s /usr/local/opt/openssl@1.1 /usr/local/opt/openssl

ln: /usr/local/opt/openssl: No such file or directory`

Does that make sense?

@v-chojas
Copy link

v-chojas commented Mar 6, 2023

I'm asking about /opt/homebrew/opt/openssl/lib, not /usr/local/opt/openssl.

@Ravenna
Copy link
Author

Ravenna commented Mar 7, 2023

@v-chojas my apologies, I had miss-understood your comment. Yes the /opt/homebrew/opt/openssl/lib folder exists.

I attached a screenshot.

I have tried removing the symlink and putting it back, I also just tried adding /usr/local/opt folder and symlinking openssl there. No luck. Any other ideas?

Screenshot 2023-03-07 at 11 00 18 AM

@v-chojas
Copy link

v-chojas commented Mar 9, 2023

Try isql -v -k '<your connection string goes here>' from a command line. Does this give the same error?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants