Sample Header Ad - 728x90

I have openssl on my macOS, but when I compile PHP, I get error

1 vote
0 answers
1298 views
I use this command compile the php on my 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
and in my macOS, I do have /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
I get below 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.
--- **Edit-01** Before ask this question, I have tried:
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
Asked by lustre (81 rep)
Nov 3, 2022, 12:13 PM
Last activity: Dec 7, 2022, 11:03 AM