OpenSSL error when installing PHP SDK on macOS Sonoma

I am encountering the “file DOWNLOAD cannot compute hash on failed download” OpenSSL error when trying to install the Couchbase PHP SDK on macOS Sonoma on a MacBook Pro M1.

I am using a UTM virtual machine with macOS Sonoma to have a clean system; however, I encountered the same errors on my actual system too.

I installed PHP via Homebrew:

brew install php

brew install cmake

pecl install couchbase

During the installation, I encountered this error:

  • The C compiler identification is AppleClang 15.0.0.15000100

– The CXX compiler identification is unknown

  • Detecting C compiler ABI info

  • Detecting C compiler ABI info - done

– Check for working C compiler: /usr/bin/cc - skipped

  • Detecting C compile features

  • Detecting C compile features - done

CMake Error at CMakeLists.txt:2 (project):

The CMAKE_CXX_COMPILER:

g++ -std=gnu++11

is not a full path and was not found in the PATH.

Tell CMake where to find the compiler by setting either the environment variable “CXX” or the Make cache entry CMAKE_CXX_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH.

  • Configuring incomplete, errors occurred!

I then set up the flags:

 export CXX=/usr/bin/g++
 export CXXFLAGS="-std=gnu++11"

However, I am now getting this error:

– Found OpenSSL prefix using Homebrew: /opt/homebrew/opt/openssl@3

– Found OpenSSL: /opt/homebrew/opt/openssl@3/lib/libcrypto.dylib (found suitable version “3.2.0”, minimum required is “1.1”)

  • OPENSSL_VERSION: 3.2.0

– OPENSSL_INCLUDE_DIR: /opt/homebrew/opt/openssl@3/include

– OPENSSL_LIBRARIES: /opt/homebrew/opt/openssl@3/lib/libssl.dylib;/opt/homebrew/opt/openssl@3/lib/libcrypto.dylib

CMake Error at deps/couchbase-cxx-client/cmake/OpenSSL.cmake:119 (file):

file DOWNLOAD cannot compute hash on failed download

status: [35; “SSL connect error”]

Call Stack (most recent call first):

deps/couchbase-cxx-client/CMakeLists.txt:70 (include)

CMake Error at deps/couchbase-cxx-client/make/OpenSSL.cmake:125 (string) : string sub-command REGEX, mode MATCH needs at least 5 arguments total to command.

Call Stack (most recent call first):

deps/couchbase-cxx-client/CMakeLists.txt:70 (include)

The same errors also occur when I try to build the sdk from the source.

I set ‘OPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl/’, but I still get the same error.

I would appreciate any insights or suggestions on how to resolve this issue. Thanks!

Thank you for the detailed information. I’ll open a jira ticket.

Hello,
We are issuing the same kind of error on with Ruby client installation.
Failling as well at OpenSSL.cmake:119
With same status status: [35; “SSL connect error”]
MacOs Sonoma
Clang 15.
Is it possible to get the link to the Jira ticket please ?

Public tickets are searchable at issues.couchbase.com

It looks like the SDKs are not yet supported on Sonoma.

from the message just before the failure - it appears that a download failed (?)

“file DOWNLOAD cannot compute hash on failed download”

The issue is by downloading twice in a row.
Here is the simpliest reproduction script :slight_smile:

file(DOWNLOAD "https://curl.se/ca/cacert.pem.sha256" "./mozilla-ca-bundle.sha256"
       TLS_VERIFY ON
       STATUS first_successful_download)
message("${first_successful_download}")
file(REMOVE "./mozilla-ca-bundle.sha256")
file(DOWNLOAD "https://curl.se/ca/cacert.pem.sha256" "./mozilla-ca-bundlex.sha256"
       TLS_VERIFY ON
       STATUS second_failed_download)
message("${second_failed_download}")

Thanks @mreiche for answer. But it does not apply.
The first attempt is successful.
BTW We do not have such /private/tmp/pear directory.

This seems to be update installtion documentaion for mac libcurl issue by sbiscigl · Pull Request #2811 · aws/aws-sdk-cpp · GitHub

Please try the work-around it describes:


:warning: If you are using MacOS Sonoma there is a [known issue](https://github.com/aws/aws-sdk-cpp/issues/2804) where using libcurl version 8.4.0 on mac can lead to issues. [This issue is being tracked with curl and apple](https://github.com/curl/curl/issues/12525). In the meanwhile please use and updated version of [curl from homebrew](https://formulae.brew.sh/formula/curl). You can include this in your project via the CMAKE_PREFIX_PATH.

 cmake -DCMAKE_PREFIX_PATH="/opt/homebrew/opt/curl/" \
  -DAUTORUN_UNIT_TESTS=OFF \
  -DBUILD_ONLY="s3" \
  -DCMAKE_INSTALL_PREFIX="~/sdk-install" \
  ..

Ruby and PHP SDKs are not yet supported on MacOS Sonoma.

I’ve opened a ticket for Ruby - Loading... and for PHP - Loading...

Fix for this first issue:

As per the second issue. It seems something got broken in CMake on MacOS X, that installed from homebrew. For some reason it bundles or using some stale certificates. The easiest way to fix it is to download official cmake from https://github.com/Kitware/CMake/releases/download/v3.28.1/cmake-3.28.1-macos-universal.dmg
and put it into path:

export PATH=/Applications/CMake.app/Contents/bin:$PATH

That should fix both issues (the patch will be released with the next version)

1 Like

Thanks Sergei and Michael.
Indeed, for Ruby sdk with Sonoma, the cmake 3.28.1 installed by homebrew is not able to build the couchbase gem whereas the same version (3.28.1) downloaded from https://github.com/Kitware/CMake/releases/download/v3.28.1/cmake-3.28.1-macos-universal.dmg works.

1 Like

This topic was automatically closed after 90 days. New replies are no longer allowed.