查询php
% brew search php
==> Formulae
brew-php-switcher php-cs-fixer [email protected] phplint phpstan
php php-cs-fixer@2 [email protected] phpmd phpunit
php-code-sniffer [email protected] phpbrew phpmyadmin
==> Casks
eclipse-php phpstorm
发现没有php5.6
% brew tap shivammathur/php
==> Tapping shivammathur/php
Cloning into '/opt/homebrew/Library/Taps/shivammathur/homebrew-php'...
remote: Enumerating objects: 5779, done.
remote: Counting objects: 100% (716/716), done.
remote: Compressing objects: 100% (100/100), done.
remote: Total 5779 (delta 634), reused 687 (delta 614), pack-reused 5063
Receiving objects: 100% (5779/5779), 705.32 KiB | 273.00 KiB/s, done.
Resolving deltas: 100% (4367/4367), done.
Tapped 8 formulae (57 files, 1MB).
再次查看
% brew search php
==> Formulae
brew-php-switcher [email protected] phpstan shivammathur/php/[email protected]
php [email protected] phpunit shivammathur/php/[email protected]
php-code-sniffer phpbrew shivammathur/php/php shivammathur/php/[email protected]
php-cs-fixer phplint shivammathur/php/[email protected] shivammathur/php/[email protected]
php-cs-fixer@2 phpmd shivammathur/php/[email protected]
[email protected] phpmyadmin shivammathur/php/[email protected]
==> Casks
eclipse-php phpstorm
发现已经有了php5.6
安装
brew install shivammathur/php/[email protected]
添加环境变量
# 终端
vim ~/.zshrc
# 新增
export PATH="/opt/homebrew/opt/[email protected]/bin:$PATH"
export PATH="/opt/homebrew/opt/[email protected]/sbin:$PATH"
# 终端 刷新 ~/.zshrc
source ~/.zshrc
查看php
% php -v
PHP 5.6.40 (cli) (built: May 13 2021 23:04:15)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
tips,建议brew源使用腾讯源,其他源容易出问题。
|
请发表评论