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

– 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):


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_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.

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

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 "" "./mozilla-ca-bundle.sha256"
       STATUS first_successful_download)
file(REMOVE "./mozilla-ca-bundle.sha256")
file(DOWNLOAD "" "./mozilla-ca-bundlex.sha256"
       STATUS 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]( where using libcurl version 8.4.0 on mac can lead to issues. [This issue is being tracked with curl and apple]( In the meanwhile please use and updated version of [curl from homebrew]( You can include this in your project via the CMAKE_PREFIX_PATH.

 cmake -DCMAKE_PREFIX_PATH="/opt/homebrew/opt/curl/" \
  -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
and put it into path:

export PATH=/Applications/$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 works.

1 Like

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