Macbook m 1 Big Surインストールphp 7.1 mondodb振り回し記
まず、How to Install PHP 7.0 / 7.1 using HomeBrew on Mac Big Surを参照してexolnet/homebrew-deprecatedというソースのインストールに失敗しました.
多角的に検索した場合、shivammathur/phpを使用してインストールに成功しました.
php 7をインストールする.1
バージョンの切り替え
brew-php-swither切替ツールのインストール
brew phpバージョンの切り替え
かんきょうへんすう
mongodb拡張のインストール
/bin/sh ./config.sub -apple-darwin20.2.0 failed
多角的に検索した場合、shivammathur/phpを使用してインストールに成功しました.
php 7をインストールする.1
$brew tap shivammathur/php
$brew search php
==> Formulae
brew-php-switcher ✔ [email protected] phpmd shivammathur/php/php shivammathur/php/[email protected]
php [email protected] phpmyadmin shivammathur/php/[email protected] shivammathur/php/[email protected]
php-code-sniffer [email protected] ✔ phpstan shivammathur/php/[email protected] shivammathur/php/[email protected] ✔
php-cs-fixer phplint phpunit shivammathur/php/[email protected] shivammathur/php/[email protected]
==> Casks
eclipse-php netbeans-php phpstorm
$brew install [email protected]
バージョンの切り替え
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 [email protected]
brew phpバージョンの切り替え
$brew-php-switcher 7.1
Switching to [email protected]
Switching your shell
Unlinking /opt/homebrew/Cellar/[email protected]/7.1.33... 0 symlinks removed
Unlinking /opt/homebrew/Cellar/[email protected]/7.4.14_1... 25 symlinks removed
Linking /opt/homebrew/Cellar/[email protected]/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/[email protected]/bin:$PATH"' >> ~/.zshrc
echo 'export PATH="/opt/homebrew/opt/[email protected]/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/[email protected]/bin:$PATH"' >> ~/.zshrc
$echo 'export PATH="/opt/homebrew/opt/[email protected]/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/[email protected]/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