3

MacOS Monterey 12.3 安装python2.7、php、替换Homebrew为国内源

 2 years ago
source link: https://chegva.com/5428.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

MacOS Monterey 12.3 安装python2.7、php、替换Homebrew为国内源

最近走教育优惠 → 2022年苹果教育优惠 Mac全系购买指南渠道 终于把用了5年的17款mac换到二线了,但是迁移到新Mac上 → 使用迁移助理将内容迁移到一台新的 Mac 上 发现之前老系统python2.7和php都被移除了,有些脚本跑不起来,只能去网上搜搜,重新装上。mark一下,给有需要的人。

安装python2.7

手动安装 Python2.7,安装后问题解决。

下载地址: https://www.python.org/ftp/python/2.7.18/python-2.7.18-macosx10.9.pkg

Homebrew替换为国内地址

苹果电脑 常规安装脚本(推荐 完全体 几分钟安装完成):
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
苹果电脑 极速安装脚本(精简版 几秒钟安装完成):
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)" speed
苹果电脑 卸载脚本:
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/HomebrewUninstall.sh)"
常见错误去下方地址查看
https://gitee.com/cunkai/HomebrewCN/blob/master/error.md
Linux电脑 安装脚本:
rm Homebrew.sh ; wget https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh ; bash Homebrew.sh
Linux电脑 卸载脚本:
rm HomebrewUninstall.sh ; wget https://gitee.com/cunkai/HomebrewCN/raw/master/HomebrewUninstall.sh ; bash HomebrewUninstall.sh

使用homwbrew安装包工具安装php,nginx,mysql

# 安装php
brew install php

# 安装nginx
brew install nginx

# 安装mysql
brew install mysql

# 启动、关闭和重启php、mysql服务分别使用
brew services start|stop|restart php/mysql

# 而nginx的服务设置因为涉及系统底层文件,需要在命令行前面加上sudo
sudo brew services start|stop|restart nginx
安志合个人博客,版权所有 丨 如未注明,均为原创 丨 转载请注明转自:https://chegva.com/5428.html | ☆★★每天进步一点点,加油!★★☆ | 

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK