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!