New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Confused how to switch PHP version #28102
Comments
Quoting from the caveats that are printed upon installation:
Thanks for filling out the template! |
@ilovezfs — Thanks! I think I missed that in the logs. I edited my shell profile: nano ~/.zshrc And added these lines for both:
Getting an error though:Running /usr/local/opt/php@7.1/bin/php But running PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/php71-gmp/gmp.so' - dlopen(/usr/local/opt/php71-gmp/gmp.so, 9): image not found in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/php71-gmp/gmp.so' - dlopen(/usr/local/opt/php71-gmp/gmp.so, 9): image not found in Unknown on line 0
PHP 7.1.17 (cli) (built: May 21 2018 22:46:54) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.1.17, Copyright (c) 1999-2018, by Zend Technologies I thought the GMP extension was now bundled with brew install php71-gmp I found this issue which recommends re-installing from source, so I tried that:
But I still get the warnings when running |
You need to clear out the old ini files from the config directories. |
Thanks! I never would have guessed that on my own. Googled with that info, and found some guides that actually explain the whole thing. |
brew install
(orupgrade
,reinstall
) a single, official formula (not cask)? If it's a generalbrew
problem please file this issue at Homebrew/brew: https://github.com/Homebrew/brew/issues/new/choose. If it's abrew cask
problem please file this issue at https://github.com/caskroom/homebrew-cask/issues/new/choose. If it's a tap (e.g. Homebrew/homebrew-php) problem please file this issue at the tap.brew update
and can still reproduce the problem?brew doctor
, fixed all issues and can still reproduce the problem?brew gist-logs <formula>
(where<formula>
is the name of the formula that failed) and included the output link?brew gist-logs
didn't work: ranbrew config
andbrew doctor
and included their output with your issue?What you were trying to do (and why)
Switch my PHP version from 7.1 to 5.6, so I could run
indexer.php
from the command line in a Magento 1 project.What happened (include command output)
Note: this is after realizing Brew 1.6 changed a bunch of PHP things, and getting everything up to date.
$ brew switch php@5.6 Cleaning /usr/local/Cellar/php@5.6/5.6.36 Opt link created for /usr/local/Cellar/php@5.6/5.6.36
$ echo PATH /Users/brendan/.composer/vendor/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
Not sure where this leaves me, but it feels like a PATH problem and something that
brew
used to solve automatically.What you expected to happen
My terminal should use PHP 5.6 after switching.
What I tried
Background: I'm a frontend developer not a sysadmin. I installed Homebrew 6 months ago because Composer wouldn't work without the
php71-gmp
package.I always try to document my self-help here:
Things I read about recent
brew
and PHP changes:I read and experimented for two hours, but I'm stuck. I ran through all the commands I could find to update/purge/clean my system:
All systems go from that end. Just lost on what
brew
did before, that I'm missing now.Extra info
Output of
brew list | grep php
:Output of
brew config
:The text was updated successfully, but these errors were encountered: