0

I'm using Mac High Sierra. I want to install PHP 7.2 with the openssl extension. I have openssl installed

localhost:php-7.2.1 davea$ brew install openssl
Warning: openssl 1.0.2n is already installed

However, when I run the PHP configure command (I'm building it from source), it eventually dies with the below error

localhost:php-7.2.1 davea$ ./configure --with-gmp=/usr/local --with-openssl --with-openssl-dir=/opt/local/bin
...
checking for Kerberos support... no
checking whether to use system default cipher list instead of hardcoded value... no
checking for RAND_egd... no
checking for pkg-config... /usr/local/bin/pkg-config
configure: error: Cannot find OpenSSL's <evp.h>

How do I tell PHP where that library is or rather how do I install it somewhere on my Mac?

ps - The reason I'm not installing PHP with homebrew is because homebrew does not support installation of PHP with GMP, which I need.

Dave
  • 15,639
  • 133
  • 442
  • 830
  • Why not install `php72-gmp` with homebrew? – Chin Leung Feb 01 '18 at 21:12
  • Purely a guess because I don't really use either of the tools... `--with-openssl-dir=/opt/local/bin` should be `--with-openssl-dir=/opt/local/`. The `bin/` directory is where the `openssl` program is located. The build system usually needs to know the root of the OpenSSL installation. The root allows the build tool to derive `/opt/local/include` and `/opt/loca/lib` to locate headers and libraries. All of this assume there is a folder `/opt/local/include/openssl` with header files; and another folder `/opt/local/lib` with `libcrypto.dylib` and `libssl.dylib` in it. – jww Feb 01 '18 at 21:50
  • @ChinLeung, where does that get installed to? I ran the command you gave and then tried to run a composer command on anotehr project and got the error, "The openssl extension is required for SSL/TLS protection but is not available. If you can not enable the openssl extension, you can disable this error, at your own risk, by setting the 'disable-tls' option to true.". I'm wondering if there is still an old version of php hanging around somewhere. – Dave Feb 01 '18 at 22:53
  • @Dave - [Does Bash have cache of executables?](https://superuser.com/q/871854/173513), [How do I clear Bash's cache of paths to executables?](https://unix.stackexchange.com/q/5609/56041), [What is the purpose of the hash command?](https://unix.stackexchange.com/q/86012/56041) and friends. – jww Feb 02 '18 at 00:37
  • Even when I restart my system I still get the same behavior. That woudl seem to eliminate caching as an issue, no? – Dave Feb 02 '18 at 15:09

0 Answers0