Macbook m1 Big Sur 安装php7.1 mondodb 折腾记
码农天地 -首先,我参考How to Install PHP 7.0 / 7.1 using HomeBrew on Mac Big Sur用exolnet/homebrew-deprecated 这个源安装失败了
/bin/sh ./config.sub -apple-darwin20.2.0 failed多方查找如果,最后使用shivammathur/php安装成功了
安装php7.1$brew tap shivammathur/php
$brew search php
==> Formulae
brew-php-switcher ✔ php@7.2 phpmd shivammathur/php/php shivammathur/php/php@7.2
php php@7.3 phpmyadmin shivammathur/php/php@5.6 shivammathur/php/php@7.3
php-code-sniffer php@7.4 ✔ phpstan shivammathur/php/php@7.0 shivammathur/php/php@7.4 ✔
php-cs-fixer phplint phpunit shivammathur/php/php@7.1 shivammathur/php/php@8.1
==> Casks
eclipse-php netbeans-php phpstorm
$brew install php@7.1切换版本安装brew-php-swither切换工具
$brew install brew-php-switcher
==> Downloading https://github.com/philcook/brew-php-switcher/archive/v2.2.tar.g
==> Downloading from https://codeload.github.com/philcook/brew-php-switcher/tar.
#=#=-# #
==> Installing brew-php-switcher
? /usr/local/Cellar/brew-php-switcher/2.2: 6 files, 11.0KB, built in 4 seconds
$brew install php@7.1
brew切换php版本
$brew-php-switcher 7.1
Switching to php@7.1
Switching your shell
Unlinking /opt/homebrew/Cellar/php@7.1/7.1.33... 0 symlinks removed
Unlinking /opt/homebrew/Cellar/php@7.4/7.4.14_1... 25 symlinks removed
Linking /opt/homebrew/Cellar/php@7.1/7.1.33... 25 symlinks created
If you need to have this software first in your PATH instead consider running:
echo 'export PATH="/opt/homebrew/opt/php@7.1/bin:$PATH"' >> ~/.zshrc
echo 'export PATH="/opt/homebrew/opt/php@7.1/sbin:$PATH"' >> ~/.zshrc
You will need sudo power from now on
Switching your apache conf
Restarting apache
All done!环境变量$echo 'export PATH="/opt/homebrew/opt/php@7.1/bin:$PATH"' >> ~/.zshrc
$echo 'export PATH="/opt/homebrew/opt/php@7.1/sbin:$PATH"' >> ~/.zshrc
$source .zshrc
$php -v
PHP 7.1.33 (cli) (built: Dec 25 2020 07:27:59) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.1.33, Copyright (c) 1999-2018, by Zend Technologies安装mongodb扩展$sudo pecl install mongodb
………………
Build process completed successfully
Installing '/opt/homebrew/Cellar/php@7.1/7.1.33/pecl/20160303/mongodb.so'
install ok: channel://pecl.php.net/mongodb-1.9.0
Extension mongodb enabled in php.ini
$php -i | grep mongo
mongodb 特别申明:本文内容来源网络,版权归原作者所有,如有侵权请立即与我们联系(cy198701067573@163.com),我们将及时处理。
php介绍
PHP即“超文本预处理器”,是一种通用开源脚本语言。PHP是在服务器端执行的脚本语言,与C语言类似,是常用的网站编程语言。PHP独特的语法混合了C、Java、Perl以及 PHP 自创的语法。利于学习,使用广泛,主要适用于Web开发领域。
下一篇: PHP如何更优雅地调用API接口
Tags 标签
phpmongodbhomebrewmacos扩展阅读
隐藏apache版本信息
2018-09-30 10:56:15 []CentOS 6.5安装php5.6
2018-09-30 11:36:53 []PHP版ZIP压缩解压类库
2018-12-22 13:11:00 []CentOS7.2安装 PHP7.3.4 操作详细教程
2020-06-28 19:09:43 []PHP 设置脚本超时时间、PHP脚本内存限制设置
2020-06-28 19:09:43 []PHP 函数filesize获取文件大小错误,一直不变
2020-06-28 19:09:43 []Linux php: command not found
2020-02-05 01:30:13 []php 缓冲区 buffer 原理
2020-06-28 19:09:43 []PHP中三种设置脚本最大执行时间的方法
2020-06-28 19:17:34 []加个好友,技术交流

