Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

thebigk's avatar
Level 13

Installing PHP 7.2 Extensions on Mac?

I've been using Valet for over a year now, but the latest brew update seems to have messed up everything. I'm trying to setup Laravel on a new mac; and can't get the sites to serve.

I installed valet and after creating a new application, I could access it without https.

However, after running valet secure site, I'm constantly getting following error:

ERR_CONNECTION_REFUSED

The problem seems to be with the SSL certificates OR php extensions; that did not get installed with PHP. I installed php using brew install [email protected] and there does not seem to be any way to install php extensions like

OpenSSL PHP Extension
PDO PHP Extension
Mbstring PHP Extension
Tokenizer PHP Extension
XML PHP Extension
Ctype PHP Extension
JSON PHP Extension

Does anyone know how to install these extensions? My best guess is that I'm getting the connection refused error because of the missing OpenSSL PHP extension. Would appreciate if you could suggest a fix.

0 likes
5 replies
Cronix's avatar

do a brew search php and look for those extensions for the version of php you have installed.

1 like
austenc's avatar

Usually those will come with PHP 7.2 by default when installed via Homebrew. What is the output of php -v and php -m? Also your valet version valet --version?

This might seem silly, but have you tried restarting your machine? I recall having problems with nginx recognizing the new PHP version when I upgraded.

thebigk's avatar
Level 13

@austenc - php version is 7.2.12 and valet version is - 2.1.1.

I just restarted machine and everything works like it's been working since ages. I think this should go into official documentation. ;-)

MaverickChan's avatar

@THEBIGK - remove some lines in your php.ini such like

extension=mbstring

because you don't need those in php 7.2 , if you write these , php will think you are trying to use customized lib.

BTW , what is your php version before updated to 7.2?

thebigk's avatar
Level 13

@maverickchan - It was 7.1.16, I guess. Thank you for the tip. I'll check what my setup looks like.

Please or to participate in this conversation.