Skip to content
Advertisement

Updating php with homebrew led to complications

My php version was 7.1.33 but in order to install a specific Laravel project I needed at least version 7.2. I’m using a Mac with High Sierra (10.13) installed.
So I installed homebrew and then this:

brew install php@7.2
echo 'export PATH="/usr/local/opt/php@7.2/bin:$PATH"' >> ~/.bash_profile
brew link php@7.2

According to php -v(in the directory of the laravel project) my version is 7.2.33, MAMP is using 7.2.8, so this is fine I think.

which php shows me: /usr/local/bin/php

and php --ini gives me /usr/local/etc/php/7.2 where my php.ini is and /usr/local/etc/php/7.2/php.ini where the loaded configuration file is located.

In the browser phpinfo of Mamp gives me these paths instead:

php.ini: /Applications/MAMP/bin/php/php7.2.8/conf
loaded configuration file: /Applications/MAMP/bin/php/php7.2.8/conf/php.ini

When trying to ‘composer install’ in said project I get an error that I can’t install some extensions. This extensions are listed in Mamp’s php.ini but not in the /usr/local/etc/php/7.2/php.ini the terminal gave me.

I’m confused what to do to resolve this issue, did I failed to install php 7.2 correctly?
Has anyone an idea what exactly went wrong or how I can use the correct php.ini (the Mamp’s one, where the extensions are listed) in the terminal when installing the composer of the project?

Advertisement

Answer

I just manually installed the extensions I needed, updating php worked fine.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement