mac 开发环境安装使用 记录

---恢复内容开始---

常用命令


1 查找文件位置:

  $locate php-fpm

  软件变动的话更新locate本地库,可能比较耗时。

  $sudo /usr/libexec/locate.updatedb

2 查找运行文件位置

  $whereis php-fpm

  $witch php-fpm

所有命令最好再超级管理员下运行,防止权限问题。要不然每次加sudo也很烦,另外安装是最好删除掉以前安装的软件


homebrew部分

是一个非常好的mac下的开发软件管理器。集安装卸载升级于一体。非常方便.尤其是额外扩展php时非常方便,比如增加memcache,imagick。。。。扩展的时候再也不用因为phpize方式遇到的各种问题烦恼了。安装找教程就可以了:

1 增加扩展源

  $brew tap homebrew/dupes

  $brew tap josegonzalez/homebrew-php

2 更新扩展源(有时候安装软件找不到,可以更新一下) 

  $brew update

3 brew update错误时

  $cd `brew --repository`

    $git reset --hard HEAD

  $sudo brew update

  如果还不行试下下面的:

  $cd `brew --repository`

  $sudo git reset --hard origin/master

  $sudo brew update

4 查找软件

  $brew search nginx

  就可以列出所有的查找的可安装的软件或扩展的版本,然后你就可以选择你需要的用brew install安装

5 安装软件

  $brew install nginx

  默认的软件安装在:/usr/local/Cellar/下

6 安装nginx

   $brew install nignx

  启动:

  $nignx

  重启:

  $nginx -s reload

  如果找不到运行文件:那么你就将安装的nginx执行文件link到 :/usr/bin下再运行

  我的在:/usr/local/Cellar/nginx/1.4.6/bin/nginx

  $cp /usr/local/Cellar/nginx/1.4.6/bin/nginx /usr/bin

  把nginx设为开机启动:(未测试)

  $mkdir -p ~/Library/LaunchAgents/  

  $cp /usr/local/Cellar/nginx/1.4.6/homebrew.mxcl.nginx.plist
~/Library/LaunchAgents/

launchctl load -w
~/Library/LaunchAgents/homebrew.mxcl.nginx.plist

  $sudo chown root:wheel
/usr/local/Cellar/nginx/1.4.6/bin/nginx
  $chmod u+s
/usr/local/Cellar/nginx/1.4.6/bin/nginx

7 安装mysql

  $brew install mysql

  配置mysql数据库:(未测试)
  $mysql_install_db
--verbose --user=`whoami` --basedir="$(brew --prefix mysql)"
--datadir=/usr/local/var/mysql --tmpdir=/tmp

  

  设置 mysql 开机启动:

  $mkdir -p ~/Library/LaunchAgents/

  $cp /usr/local/Cellar/mysql/5.6.17/homebrew.mxcl.mysql.plist
~/Library/LaunchAgents/

launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist

  mysql 配置文件:
  $/usr/local/Cellar/mysql/5.6.17/my.cnf

8 安装php


  $brew search php

  $brew install php54

  可能会让你手动link一下

  $brew link php54

  启动:

  $php-fpm

  如果找不到运行文件,需要你手动cp一份php-fpm 到 /usr/bin下,先找到php-fpm的安装位置:

  我的在:/usr/local/Cellar/php54/5.4.27/sbin/php-fpm

  $cp /usr/local/Cellar/php54/5.4.27/sbin/php-fpm /usr/bin

  $php-fpm

9 安装php扩展

  举个memcache的例子:

  $brew search memcache

  在列表中选择和你php版本相对应的memcache

  $brew install php54-memcache

  重启php-fpm

  $killall php-fpm

  $php-fpm

  然后打印phpinfo就看到了扩展已经自动加上了,好爽    

  

---恢复内容结束---

常用命令


1 查找文件位置:

  $locate php-fpm

  软件变动的话更新locate本地库,可能比较耗时。

  $sudo /usr/libexec/locate.updatedb

2 查找运行文件位置

  $whereis php-fpm

  $witch php-fpm

所有命令最好再超级管理员下运行,防止权限问题。要不然每次加sudo也很烦,另外安装是最好删除掉以前安装的软件


homebrew部分

是一个非常好的mac下的开发软件管理器。集安装卸载升级于一体。非常方便.尤其是额外扩展php时非常方便,比如增加memcache,imagick。。。。扩展的时候再也不用因为phpize方式遇到的各种问题烦恼了。安装找教程就可以了:

1 增加扩展源

  $brew tap homebrew/dupes

  $brew tap josegonzalez/homebrew-php

2 更新扩展源(有时候安装软件找不到,可以更新一下) 

  $brew update

3 brew update错误时

  $cd `brew --repository`

    $git reset --hard HEAD

  $sudo brew update

  如果还不行试下下面的:

  $cd `brew --repository`

  $sudo git reset --hard origin/master

  $sudo brew update

4 查找软件

  $brew search nginx

  就可以列出所有的查找的可安装的软件或扩展的版本,然后你就可以选择你需要的用brew install安装

5 安装软件

  $brew install nginx

  默认的软件安装在:/usr/local/Cellar/下

6 安装nginx

   $brew install nignx

  启动:

  $nignx

  重启:

  $nginx -s reload

  如果找不到运行文件:那么你就将安装的nginx执行文件link到 :/usr/bin下再运行

  我的在:/usr/local/Cellar/nginx/1.4.6/bin/nginx

  $cp /usr/local/Cellar/nginx/1.4.6/bin/nginx /usr/bin

  把nginx设为开机启动:(未测试)

  $mkdir -p ~/Library/LaunchAgents/  

  $cp /usr/local/Cellar/nginx/1.4.6/homebrew.mxcl.nginx.plist
~/Library/LaunchAgents/

launchctl load -w
~/Library/LaunchAgents/homebrew.mxcl.nginx.plist

  $sudo chown root:wheel
/usr/local/Cellar/nginx/1.4.6/bin/nginx
  $chmod u+s
/usr/local/Cellar/nginx/1.4.6/bin/nginx

7 安装mysql

  $brew install mysql

  配置mysql数据库:(未测试)
  $mysql_install_db
--verbose --user=`whoami` --basedir="$(brew --prefix mysql)"
--datadir=/usr/local/var/mysql --tmpdir=/tmp

  

  设置 mysql 开机启动:

  $mkdir -p ~/Library/LaunchAgents/

  $cp /usr/local/Cellar/mysql/5.6.17/homebrew.mxcl.mysql.plist
~/Library/LaunchAgents/

launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist

  mysql 配置文件:
  $/usr/local/Cellar/mysql/5.6.17/my.cnf

8 安装php


  $brew search php

  $brew install php54

  可能会让你手动link一下

  $brew link php54

  启动:

  $php-fpm

  如果找不到运行文件,需要你手动cp一份php-fpm 到 /usr/bin下,先找到php-fpm的安装位置:

  我的在:/usr/local/Cellar/php54/5.4.27/sbin/php-fpm

  $cp /usr/local/Cellar/php54/5.4.27/sbin/php-fpm /usr/bin

  $php-fpm

9 安装php扩展

  举个memcache的例子:

  $brew search memcache

  在列表中选择和你php版本相对应的memcache

  $brew install php54-memcache

  重启php-fpm

  $killall php-fpm

  $php-fpm

  然后打印phpinfo就看到了扩展已经自动加上了,好爽    

  

mac 开发环境安装使用 记录,布布扣,bubuko.com

时间: 2024-08-03 15:29:12

mac 开发环境安装使用 记录的相关文章

quick-cocos2d-x for mac开发环境安装配置

我的开发环境 操作系统:mac Cocos2d-x:v3.2 Cocos2d-lua(quick-cocos2d-x):v3.2-RC1 Cocos Studio:v2.0.2 Cocos Code IDE :v1.0.1(64bit) 安装步骤 安装Cocos2d-x 把下载好的cocos2d-x-3.2移动到工作目录 运行目录下的setup.py 更新环境变量source ~/.bash_profile 安装Cocos2d-lua 运行安装包quick-3.2rc1-mac.dmg 将安装好

mac 开发环境安装

0: 安装brew : mac终端输入: /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 1:使用brew安装git命令:  brew install git 2: jdk安装: brew  install java (输入后默认安装的是jdk最新版本) 制定安装jdk版本(这里命令以安装jdk8为例): brew tap caskroo

mac开发环境安装

1.http://www.tuicool.com/articles/2yM7Z3 2.http://elf8848.iteye.com/blog/1582137 3.http://blog.csdn.net/pang040328/article/details/41259385 4.http://xiao990987.blog.163.com/blog/static/112648814201331794014339/ 待整理……

MAPR 开发环境搭建过程记录

我下载了MAPR 官方提供的virtualbox 和 vmware版本的sandbox进行试用. 开始试用了一会vmware版的,因为不太熟悉vmware的操作,而且vmplayer经常没有反应,后来改用了virtualbox版. 因为sandbox是单机版的,所以必须把网络设置设为host only,否则服务是无法正常启动的. 即使是这样,服务时常因为超时无法正常启动,这时我们可以在按alt+F2进入系统后重启服务即可.可能需要多尝试几次. 我想在sandbox中使用eclipse开发mapr

OGEngine v2.1.1 Mac开发环境搭建

OGEngine v2.1.1 Mac开发环境搭建 OGEngine v2.1.1拓展了iOS平台的支持,我们现在来搭建下开发环境.注意,由于iOS版本的编译开发必须在Mac系统上,所以我们的部署也是在Mac环境下进行的. 1. 检查系统 建议系统版本在 v10.8.5以上 2. 安装Xcode 建议5.1.1以上版本 可打开AppStore下载,程序较大2.3G大小,时间可能较长. 安装完后可以确认下是否安装成功:打开Xcode,新建一个工程,在模拟器上运行确认. 3. 搭建Java环境 Ja

第1章 开发环境安装和配置(一):概述

原文 第1章 开发环境安装和配置(一):概述 目前Android在全世界市场上大约有75%的占有率,国人Android手机的持有比例更甚,甚至达到90%以上[网上找的介绍,不必在意]. 用C#开发手机应用程序,建议首选VS2015,这是因为VS2015内置的是C# 6.0,很多原来实现起来比较繁琐的操作,在VS2015下也都变得非常简单了. 1.跨平台移动应用开发 VS2015的移动跨平台采用Xamarin架构,这让原本就熟悉Visual Studio的开发者不用再熟悉其他的开发工具就能直接开发

Typescript 开发环境安装、Node.js安装以及输出HelloWorld

1.为什么要学习Typescript 语言呢 原因很简单,当然是为了工作呀,因为工作使我接触到了Typescript语言,感觉它比较像C#.Java 这样面向对象的语言,由于最近在使用它开发项目所以系统学习一下,在此记录一下学习过程. 2.Typescript 语言百度百科介绍 TypeScript是一种由微软开发的自由和开源的编程语言.它是JavaScript的一个超集,而且本质上向这个语言添加了可选的静态类型和基于类的面向对象编程.TypeScript还遵循ES6.ES5规范,同时因为是Ja

React Native 开发环境安装和配置使用报错: -bash: react-native: command not found

[React  Native 开发环境安装和配置:-bash: react-native: command not found 报错: 前提是安装homebrew,node.js ,npm ,watchman,flow都成功.React  Native 开发环境安装和配置 执行react-native init TestProject 命令 创建demo时报错:-bash: react-native: command not found 报错提示:Please include the follo

linux下c++开发环境安装(eclipse+cdt)

方法一: 此外,众所周知,Eclipse是Java程序,因此很容易就实现了跨平台,也是众所周知,Java的大型程序非常吃内存,即使有512MB内存, 仍然感觉Eclipse的启动速度很慢.个人认为1GB内存是你工作效率的保证.其余的东西,需待我深入学习以后再进一步分析. 据网友的经验,先安装Eclipse Classic,然后再装CDT(C/C++ Development Tool),这样虽然体积大了一点但是方便日后添加Tool Kit. 在Ubuntu上安装Eclipse有两种方法:1. 使用