How is it possible to install openssl and curl extension for PHP8 on mac?

514 Views Asked by At

I installed PHP 8 with:

brew install php

Then I edited php.ini to enable curl and openssl:

extension=curl
extension=openssl 

I use the default extension dir

extension_dir = "/opt/homebrew/lib/php/pecl/20220829"

I get this error (and the same for curl):

PHP Warning:  PHP Startup: Unable to load dynamic library 'openssl' (tried: /opt/homebrew/lib/php/pecl/20220829/openssl (dlopen(/opt/homebrew/lib/php/pecl/20220829/openssl, 0x0009): tried: '/opt/homebrew/lib/php/pecl/20220829/openssl' (no such file)), /opt/homebrew/lib/php/pecl/20220829/openssl.so (dlopen(/opt/homebrew/lib/php/pecl/20220829/openssl.so, 0x0009): tried: '/opt/homebrew/lib/php/pecl/20220829/openssl.so' (no such file))) in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'openssl' (tried: /opt/homebrew/lib/php/pecl/20220829/openssl (dlopen(/opt/homebrew/lib/php/pecl/20220829/openssl, 0x0009): tried: '/opt/homebrew/lib/php/pecl/20220829/openssl' (no such file)), /opt/homebrew/lib/php/pecl/20220829/openssl.so (dlopen(/opt/homebrew/lib/php/pecl/20220829/openssl.so, 0x0009): tried: '/opt/homebrew/lib/php/pecl/20220829/openssl.so' (no such file))) in Unknown on line 0

I tried to install it with:

pecl install openssl

But I got:

No releases available for package "pecl.php.net/openssl"
install failed

The /opt/homebrew/lib/php/pecl/20220829 directory is empty. I'm not sure where the extensions are located

0

There are 0 best solutions below