PHPBrew install [email protected] with [email protected]


Issue

make: *** [ext/openssl/openssl.lo] Error 1

OR like

_php_openssl_sockop_set_option in xp_ssl.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ld: symbol(s) not found for architecture x86_64

Step

  1. Find current installed openssl
1
brew search openssl
  1. By Case

    2.1 If [email protected] not installed

    1
    brew install [email protected]

    2.2 If openssl@3 installed and [email protected] not installed

    1
    2
    brew unlink openssl@3
    brew install [email protected]

    2.3 If [email protected] and openssl@3 are installed

    1
    brew unlink openssl@3
  2. Install the PHP8.0, custom sqlite, zlib and openssl

    1
    2
    3
    4
    LDFLAGS="-L/usr/local/opt/sqlite/lib -L/usr/local/opt/[email protected]/lib" \
    CPPFLAGS="-I/usr/local/opt/sqlite/include -I/usr/local/opt/[email protected]/include" \
    PKG_CONFIG_PATH="/usr/local/opt/[email protected]/lib/pkgconfig" \
    phpbrew install 8.0.17 +default +dbs +intl +zlib=/usr/local/opt/zlib +openssl=/usr/local/opt/[email protected]
  3. Link the openssl again

    1
    brew link openssl@3

Reference