Skip to content

Instantly share code, notes, and snippets.

@yuki777
Last active May 24, 2024 14:10
Show Gist options
  • Save yuki777/6244823b8aa8cf4457e97e6407ada5ad to your computer and use it in GitHub Desktop.
Save yuki777/6244823b8aa8cf4457e97e6407ada5ad to your computer and use it in GitHub Desktop.
Link the php installed by Brew to ~/.phpenv/versions
@yuki777
Copy link
Author

yuki777 commented Apr 12, 2022

# Usage
curl -fsSL https://gist.githubusercontent.com/yuki777/6244823b8aa8cf4457e97e6407ada5ad/raw/2a2f0ff6b295c5075216b3e4cfc3e0b3b37af6af/link-phps.bash | bash

@yuki777
Copy link
Author

yuki777 commented Nov 16, 2022

# Tests
mkdir -p /tmp/php74 /tmp/php80 /tmp/php81
cd /tmp         && phpenv global 8.1    && php -v # It should be 8.1
cd /tmp/php74   && phpenv local  7.4    && php -v # It should be 7.4
cd /tmp/php80   && phpenv local  8.0    && php -v # It should be 8.0
cd /tmp/php81   && phpenv local  8.1    && php -v # It should be 8.1

@kerren
Copy link

kerren commented Feb 1, 2024

Very cool, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment