Mac 搭建后端PHP+Go环境
准备工作
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环境的更多相关文章
- mac搭建cordova的android环境
搭建步骤: 1,下载cordova-android解压到自己目录 2,安装node.js:下载地址:http://nodejs.org/,解压按步骤安装即可,检测在终端输入:#npm 3,安装dos2 ...
- Mac搭建 Eclipse +Pydev+Python 环境
Mac配置Python开发环境(Eclipse +Pydev+Python) 1.首先下载MAC版的64位Eclipse. eclips下载地址打开链接,选择需要的版本下载 2.下载Python. M ...
- mac 搭建APK反编译环境[转]
APKtool 用途:获取mainifest.xml res等资源文件 下载:http://ibotpeaches.github.io/Apktool/install/ 使用:apktool d te ...
- mac 搭建Java Spring boot 环境(eclipse)
安装 下载安装Springboot 安装完成后,创建项目 1. 2. 3. 完成创建!
- mac 搭建Java Spring boot 环境(idea)
首先安装插件 安装下面的这个插件 然后重启idea,新建工程 选择新建 Springboot 框架 改写项目名称 选择类型 设置工程名称 删除多余的文件 编译工程 然后运行 1. 2. 参考: htt ...
- Mac系统下React Native环境搭建
这里记录一下在Mac系统下搭建React Native开发环境的过程: 1. 安装HomeBrew: /usr/bin/ruby -e "$(curl -fsSL https://raw.g ...
- Mac 搭建 SVN 服务器环境
Mac 搭建 SVN 服务器环境 一.创建svn repository svnadmin create /path/svn/pro //仓库位置,svn是svn的目录,pro是一个版本库的目录 PS: ...
- java Mac自动化-java和ant环境搭建
本文旨在帮助读者介绍,如果一个测试工程师拿到了mac本,该如何在本地搭建java和ant环境 其实在几年前,我们还大多使用的是windows本,而且我们也会比较善于使用windows笔记本,但自从ma ...
- mac上搭建appium+IOS自动化测试环境(一)
阅读须知 由于OS X系统最近才开始接触,所以有些东西也不是很清楚,这里只提供方法不提供原理,能解释清楚的我也会尽量解释.可能也有一些地方说的不严谨或有错的,还望大家指点一二. 实验环境 操作系统: ...
随机推荐
- 重新整理 .net core 周边阅读篇————AspNetCoreRateLimit[一]
前言 整理了一下.net core 一些常见的库的源码阅读,共32个库,记100余篇. 以下只是个人的源码阅读,如有错误或者思路不正确,望请指点. 正文 github 地址为: https://git ...
- Python - 生成requirement.text 文件
前言 该篇操作笔记摘自小菠萝 Python项目中,一般都会有一个 requirements.txt 文件 这个文件主要是用于记录当前项目下的所有依赖包及其精确的版本号,以方便在一个新环境下更快的进行部 ...
- P1088 [NOIP2004 普及组] 火星人
题目描述 人类终于登上了火星的土地并且见到了神秘的火星人.人类和火星人都无法理解对方的语言,但是我们的科学家发明了一种用数字交流的方法.这种交流方法是这样的,首先,火星人把一个非常大的数字告诉人类科学 ...
- GUI自动化测试遇到的问题
学习接口自动化测试框架或工具,UI自动化测试框架或工具,有时会觉得知识似乎比较零散,死记硬背不是一个好方法.一个学习的思路是思考使用这些框架或工具的时候,可能会遇到什么问题,遇到这些问题可以通过什么方 ...
- JavaScript 原生控制元素添加删除
参考: https://blog.csdn.net/leijie0322/article/details/80664554 https://www.cnblogs.com/jpfss/p/910620 ...
- IceCream in Python
IceCream in Python 你还在使用print 在Python 中 debug 吗?赶快使用Icecream吧. 提到 Icecream,你是不是会想到ta? 动机 如果你使用print去 ...
- 看动画学算法之:doublyLinkedList
目录 简介 doublyLinkedList的构建 doublyLinkedList的操作 头部插入 尾部插入 插入给定的位置 删除指定位置的节点 简介 今天我们来学习一下复杂一点的LinkedLis ...
- 13万字详细分析JDK中Stream的实现原理
前提 Stream是JDK1.8中首次引入的,距今已经过去了接近8年时间(JDK1.8正式版是2013年底发布的).Stream的引入一方面极大地简化了某些开发场景,另一方面也可能降低了编码的可读性( ...
- Centos7 配置JDK 提示 /lib/ld-linux.so.2: bad ELF interpreter: No such file or direct
解决办法:yum install glibc.i686
- 从零入门 Serverless | 一文讲透 Serverless Kubernetes 容器服务
作者 | 张维(贤维) 阿里云函数计算开发工程师 导读:Serverless Kubernetes 是以容器和 kubernetes 为基础的 Serverless 服务,它提供了一种简单易用.极致弹 ...