• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Mac M1 安装php5.6

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

查询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源使用腾讯源,其他源容易出问题。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
php5.4的arm交叉编译发布时间:2022-07-10
下一篇:
php Laravel 框架 介绍及安装 - youxin发布时间:2022-07-10
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap