• 在 M1 芯片 Mac 上使用 Homebrew


    在 M1 芯片 Mac 上使用 Homebrew

    1.安装brew(国内源):

    /bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
    
    • 1

    2.M1芯片安装完成后会出现,终端输入brew 会出现 zsh: command not found: brew 的问题

    解决:这是配置项出错,brew的下载路径在/opt/homebrew/bin,所以我们要在 根目录创建zshrc,并写入相关的路径

    touch .zshrc
    open .zshrc
    
    • 1
    • 2

    写入:

    path=('/opt/homebrew/bin' $path)
    export PATH
    
    • 1
    • 2

    3.下载 php,mySql 推荐使用 PhpWebStudy, 推荐使用阿里的源

    报错:

    curl: (92) HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1) Error: php@8.3: Failed to download resource "php@8.3" Download failed: https://ghcr.io/v2/shivammathur/php/php/8.3/blobs/sha256:f429c0d4807e7daa511bec9099f7855cdb245f710b5fcd0a9bde8cdee314846e
    
    • 1

    解决:将HTTP版本从2降级到1.1后工作,相关的文章

    git config --global http.version HTTP/1.1
    
    • 1

    下载完成后更改回来:

    git config --global http.version HTTP/2
    
    • 1

    Php 第一次配置:

    php@8.3 is keg-only, which means it was not symlinked into /opt/homebrew,
    because this is an alternate version of another formula.
    
    If you need to have php@8.3 first in your PATH, run:
    echo 'export PATH="/opt/homebrew/opt/php@8.3/bin:$PATH"' >> ~/.zshrc
    echo 'export PATH="/opt/homebrew/opt/php@8.3/sbin:$PATH"' >> ~/.zshrc
    
    For compilers to find php@8.3 you may need to set:
    export LDFLAGS="-L/opt/homebrew/opt/php@8.3/lib"
    export CPPFLAGS="-I/opt/homebrew/opt/php@8.3/include"
    
    To start shivammathur/php/php@8.3 now and restart at login:
    brew services start shivammathur/php/php@8.3
    Or, if you don't want/need a background service you can just run:
    /opt/homebrew/opt/php@8.3/sbin/php-fpm --nodaemonize
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    echo 'export PATH="/opt/homebrew/opt/php@8.3/bin:$PATH"' >> ~/.zshrc
    echo 'export PATH="/opt/homebrew/opt/php@8.3/sbin:$PATH"' >> ~/.zshrc
    
    • 1
    • 2

    @蚵仔煎-20231107

  • 相关阅读:
    很多Oracle中的SQL语句在EF中写不出来
    钓鱼邮件又出新花样
    为什么不试试神奇的3407呢?
    【Linux】进程概念 —— 虚拟内存地址空间
    多线程python实现和多线程有序性
    分布式系统架构理论与组件
    MySQL数据库管理基本操作(二)
    蓝桥等考C++组别八级002
    <Linux系统复习>共享内存
    springboot中实现查看flowable流程图和xml文件功能
  • 原文地址:https://blog.csdn.net/Zhuang_weixin/article/details/134270254