MAC 安装PHP及环境配置 保姆级别
admin 阅读: 2024-03-16
后台-插件-广告管理-内容页头部广告(手机) |
1、首先命令行进行安装
brew install php@8.0第一次安装可能会出现的问题
a、安装版本问题
- Warning: No available formula with the name "php@8.4". Did you mean php@8.1, php@8.0 or php@7.4?
- ==> Searching for similarly named formulae and casks...
- ==> Formulae
- php@8.1 php@8.0 php@7.4
- To install php@8.1, run:
- brew install php@8.1
出现该问题的原因安装的版本问题,根据提示进行下载安装对应的版本即可
b、出现error
- fatal: not in a git directory
- Error: Command failed with exit 128: git
解决办法:直接运行brew -v
brew -v- mark@192 ~ % brew -v
- Homebrew 4.0.19-9-g8aaf99e
- fatal: detected dubious ownership in repository at '/opt/homebrew/Library/Taps/homebrew/homebrew-core'
- To add an exception for this directory, call:
- git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-core
- Homebrew/homebrew-core (no Git repository)
- fatal: detected dubious ownership in repository at '/opt/homebrew/Library/Taps/homebrew/homebrew-cask'
- To add an exception for this directory, call:
- git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-cask
- Homebrew/homebrew-cask (no Git repository)
看到有两个git config,分别运行一下即可,如下
- mark@192 ~ % git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-core
- mark@192 ~ % git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-cask
完成之后在运行:arch -arm64 brew install cocoapods
mark@192 ~ % arch -arm64 brew install cocoapods运行结果
- ==> Downloading https://formulae.brew.sh/api/formula.jws.json
- ################################################################################################################### 58.8%curl: (28) Operation too slow. Less than 100 bytes/sec transferred the last 5 seconds
- Warning: formula.jws.json: update failed, falling back to cached version.
- ==> Downloading https://formulae.brew.sh/api/formula.jws.json
- ##################################################################################################################################################################################################### 100.0%
- ==> Downloading https://formulae.brew.sh/api/cask.jws.json
- ##################################################################################################################################################################################################### 100.0%
- Warning: Treating cocoapods as a formula. For the cask, use homebrew/cask/cocoapods
- ==> Fetching dependencies for cocoapods: libyaml, ca-certificates, openssl@1.1, readline and ruby
- ==> Fetching libyaml
- ==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/libyaml-0.2.5.arm64_ventura.bottle.tar.gz
- ##################################################################################################################################################################################################### 100.0%
- ==> Fetching ca-certificates
- ==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/ca-certificates-2023-01-10.all.bottle.tar.gz
- Already downloaded: /Users/mark/Library/Caches/Homebrew/downloads/08486bb5b9927def5c947c5a9e4a873eacd6364ac9cf6e50bfe3aa0bfc1c63ed--ca-certificates-2023-01-10.all.bottle.tar.gz
- ==> Fetching openssl@1.1
- ==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/openssl%401.1-1.1.1t.arm64_ventura.bottle.tar.gz
- Already downloaded: /Users/mark/Library/Caches/Homebrew/downloads/339aa132aee19ced825e32e534324ac7fddc1948efbf19216760c835d71c395b--openssl@1.1-1.1.1t.arm64_ventura.bottle.tar.gz
- ==> Fetching readline
- ==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/readline-8.2.1.arm64_ventura.bottle.tar.gz
- Already downloaded: /Users/mark/Library/Caches/Homebrew/downloads/61eadcc12bccc526220de0af71471c1f84d36861ce68a1e85979887e904b4e56--readline-8.2.1.arm64_ventura.bottle.tar.gz
- ==> Fetching ruby
- ==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/ruby-3.2.2.arm64_ventura.bottle.tar.gz
- ##################################################################################################################################################################################################### 100.0%
- ==> Fetching cocoapods
- ==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/cocoapods-1.12.1.arm64_ventura.bottle.tar.gz
- ##################################################################################################################################################################################################### 100.0%
- ==> Installing dependencies for cocoapods: libyaml, ca-certificates, openssl@1.1, readline and ruby
- ==> Installing cocoapods dependency: libyaml
- ==> Pouring libyaml-0.2.5.arm64_ventura.bottle.tar.gz
声明
1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,请转载时务必注明文章作者和来源,不尊重原创的行为我们将追究责任;3.作者投稿可能会经我们编辑修改或补充。
在线投稿:投稿 站长QQ:1888636
后台-插件-广告管理-内容页尾部广告(手机) |