J'utilise cette commande pour compiler le php sur mon 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
et dans mon MacOS, j'ai /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
Je reçois l'erreur suivante :
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
Avant de poser cette question, j'ai essayé :
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