1 votos

Tengo openssl en mi MacOS, pero cuando compilo PHP, me da error

Yo uso este comando para compilar el php en mi MacOS:

./configure \
  --prefix=/opt/php-7.4.30 \
  --with-config-file-path=/opt/php-7.4.30/etc \
  --with-pdo-mysql=mysqlnd \
  --with-mysqli=mysqlnd \
  --with-libxml-dir \
  --with-gd \
  --with-jpeg-dir \
  --with-png-dir \
  --with-freetype-dir \
  --with-iconv=/opt/homebrew/Cellar/libiconv/1.17 \
  --with-zlib-dir=/opt/homebrew/Cellar/zlib/1.2.12_1 \
  --with-bz2=/opt/homebrew/Cellar/bzip2/1.0.8 \
  --with-openssl=/opt/homebrew/Cellar/openssl@3/3.0.5/\
  --with-curl=/opt/homebrew/Cellar/curl/7.85.0 \
  --enable-soap \
  --enable-mbstring \
  --enable-sockets \
  --enable-exif \
  --with-readline=/opt/homebrew/Cellar/readline/8.1.2 \
  --disable-ipv6

y en mi MacOS, tengo /opt/homebrew/Cellar/openssl@1.1/1.1.1q

 % ls /opt/homebrew/Cellar/openssl@1.1/1.1.1q 
AUTHORS         INSTALL_RECEIPT.json    NEWS            bin         lib
CHANGES         LICENSE         README          include         share

Me sale el siguiente error:

Configuring extensions
checking io.h usability... no
checking io.h presence... no
checking for io.h... no
checking for strtoll... yes
checking for atoll... yes
checking whether to build with LIBXML support... yes
checking for libxml-2.0 >= 2.7.6... yes
checking for OpenSSL support... yes
checking for Kerberos support... no
checking whether to use system default cipher list instead of hardcoded value... no
checking for openssl >= 1.0.1... no
configure: error: Package requirements (openssl >= 1.0.1) were not met:

No package 'openssl' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables OPENSSL_CFLAGS
and OPENSSL_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

Edición-01

Antes de hacer esta pregunta, lo he intentado:

export OPENSSL_CFLAGS="/opt/homebrew/Cellar/openssl@3/3.0.5/include" 
export OPENSSL_LIBS="/opt/homebrew/Cellar/openssl@3/3.0.5/lib"

export PKG_CONFIG_PATH=/opt/homebrew/Cellar/openssl@3/3.0.5/lib/pkgconfig:$PKG_CONFIG_PATH

0voto

Yoan Puntos 1

Pruebe en el terminal el comando brew info openssl@1.1 y lo verás:

openssl@1.1 es sólo keg, lo que significa que no se ha enlazado simbólicamente en /opt/homebrew, porque MacOS proporciona LibreSSL.

Si necesita tener openssl@1.1 primero en su PATH, ejecute echo 'export PATH="/opt/homebrew/opt/openssl@1.1/bin:$PATH"' >> ~/.zshrc

Para que los compiladores encuentren openssl@1.1 puede ser necesario establecer:

export LDFLAGS="-L/opt/homebrew/opt/openssl@1.1/lib"

export CPPFLAGS="-I/opt/homebrew/opt/openssl@1.1/include"

Para que pkg-config encuentre openssl@1.1 es posible que tenga que configurar: export PKG_CONFIG_PATH="/opt/homebrew/opt/openssl@1.1/lib/pkgconfig"

AppleAyuda.com

AppleAyuda es una comunidad de usuarios de los productos de Apple en la que puedes resolver tus problemas y dudas.
Puedes consultar las preguntas de otros usuarios, hacer tus propias preguntas o resolver las de los demás.

Powered by:

X