准备工作

1. 安装brew命令

#很慢很慢。。
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

替换国内源:

#下载脚本
curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install >> brew_install
#替换国内源
BREW_REPO = “https://github.com/Homebrew/brew“.freeze
BREW_REPO = "https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git".freeze
#执行
chmod 777 brew_install
./brew_install

安装PHP环境

安装lnmp

1.Nginx

• 安装nginx brew install nginx
• 启动nginx sudo nginx
• 访问 http://localhost:8080/

2.安装php

  • 苹果是自带PHP的,如果不是要的版本可以安装其他版本再切换
  • 安装PHP
brew install php72
  • 直接安装7.2然后切换版本(推荐)
brew link php@7.2 --force --overwrite
echo 'export PATH="/usr/local/opt/php@7.2/bin:$PATH"' >> ~/.bash_profile
echo 'export PATH="/usr/local/opt/php@7.2/sbin:$PATH"' >> ~/.bash_profile
  • 查看php.ini目录
php --ini
php -v
php -m

3.安装mysql

brew install mysql56

4.更换composer源

最近换了mac好多的用不习惯安装了composer但是下载不了laravel.

执行以下命令再下载laravel

sudo composer config -g repo.packagist composer https://packagist.phpcomposer.com

安装swoole

pecl install swoole

private/tmp/pear/install/xdebug/xdebug.c:25:10: fatal error: 'php.h' file not found

brew doctor

brew link --overwrite php

lixindeMBP:~ lixin$ brew link --overwrite php@7.2

Warning: php@7.2 is keg-only and must be linked with --force

If you need to have this software first in your PATH instead consider running:

echo 'export PATH="/usr/local/opt/php@7.2/bin:$PATH"' >> ~/.bash_profile

echo 'export PATH="/usr/local/opt/php@7.2/sbin:$PATH"' >> ~/.bash_profile

lixindeMBP:~ lixin$ echo 'export PATH="/usr/local/opt/php@7.2/bin:$PATH"' >> ~/.bash_profile
lixindeMBP:~ lixin$ echo 'export PATH="/usr/local/opt/php@7.2/sbin:$PATH"' >> ~/.bash_profile
lixindeMBP:~ lixin$ source ~/.bash_profile

安装Go环境

1.Go编译器安装

  • 官网下载安装包,比较快
  • brew install go
  • 添加环境变量
//编辑~/.bash_profile文件
vim ~/.bash_profile //在~/.bash_profile文件中添加以下2条命令
export GOROOT=/usr/local/go
export PATH=$PATH:$GOROOT/bin export PATH="/Users/lixin/go/bin:$PATH" //使配置生效
localhost:~ zxy$ source ~/.bash_profile

2.Goland的配置

参考:https://blog.csdn.net/zxy_666/article/details/80182688

核心步骤:



其他软件

1.抓包破解

Registered Name:  https://zhile.io
License Key: 48891cf209c6d32bf4

2.phpStrom

汉化:
点击应用程序–>右击PhpStorm选择显示包内容–>Contents–>lib

Mac 搭建后端PHP+Go环境的更多相关文章

  1. mac搭建cordova的android环境

    搭建步骤: 1,下载cordova-android解压到自己目录 2,安装node.js:下载地址:http://nodejs.org/,解压按步骤安装即可,检测在终端输入:#npm 3,安装dos2 ...

  2. Mac搭建 Eclipse +Pydev+Python 环境

    Mac配置Python开发环境(Eclipse +Pydev+Python) 1.首先下载MAC版的64位Eclipse. eclips下载地址打开链接,选择需要的版本下载 2.下载Python. M ...

  3. mac 搭建APK反编译环境[转]

    APKtool 用途:获取mainifest.xml res等资源文件 下载:http://ibotpeaches.github.io/Apktool/install/ 使用:apktool d te ...

  4. mac 搭建Java Spring boot 环境(eclipse)

    安装 下载安装Springboot 安装完成后,创建项目 1. 2. 3. 完成创建!

  5. mac 搭建Java Spring boot 环境(idea)

    首先安装插件 安装下面的这个插件 然后重启idea,新建工程 选择新建 Springboot 框架 改写项目名称 选择类型 设置工程名称 删除多余的文件 编译工程 然后运行 1. 2. 参考: htt ...

  6. Mac系统下React Native环境搭建

    这里记录一下在Mac系统下搭建React Native开发环境的过程: 1. 安装HomeBrew: /usr/bin/ruby -e "$(curl -fsSL https://raw.g ...

  7. Mac 搭建 SVN 服务器环境

    Mac 搭建 SVN 服务器环境 一.创建svn repository svnadmin create /path/svn/pro //仓库位置,svn是svn的目录,pro是一个版本库的目录 PS: ...

  8. java Mac自动化-java和ant环境搭建

    本文旨在帮助读者介绍,如果一个测试工程师拿到了mac本,该如何在本地搭建java和ant环境 其实在几年前,我们还大多使用的是windows本,而且我们也会比较善于使用windows笔记本,但自从ma ...

  9. mac上搭建appium+IOS自动化测试环境(一)

    阅读须知 由于OS X系统最近才开始接触,所以有些东西也不是很清楚,这里只提供方法不提供原理,能解释清楚的我也会尽量解释.可能也有一些地方说的不严谨或有错的,还望大家指点一二. 实验环境 操作系统: ...

随机推荐

  1. PC+PLC通过Modbus协议构建工控系统

    一. 概述 工业设备采用HMI+PLC控制是比较常见的方案,随着工业自动化的要求越来越高,现在很多设备都要求接入企业MES系统,MES系统一般为WEB系统,接口形式大部分为HTTP协议,这种传统方案和 ...

  2. python刷题第三周

    以下是本周有所收获的题目 第一题: 第4章-4 验证"哥德巴赫猜想" (20 分) 数学领域著名的"哥德巴赫猜想"的大致意思是:任何一个大于2的偶数总能表示为两 ...

  3. modern php enable zend opcache

    字节码缓存能存储预先编译好的php代码 * 如果是自己编译PHP ./configure --enable-opcache 编译好后 php.ini zend_extension=opcache.so ...

  4. JavaScript 获取html元素

    1.通过ID获取: document.getElementById("idname"); 2.通过class.tagname获取: var wcyclass = document. ...

  5. P7470-[NOI Online 2021 提高组]岛屿探险【Trie,CDQ分治】

    正题 题目链接:https://www.luogu.com.cn/problem/P7470 题目大意 给出\(n\)个二元组\((a,b)\). \(q\)次询问给出\((l,r,c,d)\)表示询 ...

  6. selenium--多窗口

    多窗口/句柄 有些页面的链接打开后,会重新打开一个窗口,对于这种情况,想在新页面上操作,就得先切换窗口了.获取窗口的唯一标识用句柄表示,所以只需要切换句柄,我们就能在多个页面上灵活自如的操作了. 1. ...

  7. mybatis中#{}与${}取值的区别

    1. 首先对于一个接口 Employee getEmpByIdAndName(@Param("id") Integer id,@Param("empName") ...

  8. 《手把手教你》系列技巧篇(二十五)-java+ selenium自动化测试-FluentWait(详细教程)

    1.简介 其实今天介绍也讲解的也是一种等待的方法,有些童鞋或者小伙伴们会问宏哥,这也是一种等待方法,为什么不在上一篇文章中竹筒倒豆子一股脑的全部说完,反而又在这里单独写了一篇.那是因为这个比较重要,所 ...

  9. 洛谷4248 AHOI2013差异 (后缀数组SA+单调栈)

    补博客! 首先我们观察题目中给的那个求\(ans\)的方法,其实前两项没什么用处,直接\(for\)一遍就求得了 for (int i=1;i<=n;i++) ans=ans+i*(n-1); ...

  10. 关于 WinDoAdmin

    WinDoAdmin(有温度,更有深度) an amazing winform admin 框架描述 最新基于Winform实现的Web样式中后台解决方案,大型企业级开发框架. 如果你要使用Winfo ...