当前位置:   article > 正文

xcode php开发,配置mac开发环境

the firewall 无 was not found

按键

⌘(command)、⌥(option)、⇧(shift)、⌃(control)

安装secureCrt

secureCrt用于连接远程终端

将windows的cinfig目录放到mac上报

The firewall ‘无’ was not found in the database .

This session will attempt to connect without a firewall

在config目录下执行下面命令解决

find . -name '*.ini' -type f -exec sed -i '' 's/=无/=None/g' '{}' \;

安装xcode

app store升级mac os x ,安装 xcode

xcode自带了svn、git、php、python、ruby

安装homebrew

安装homebrew,使用os x不提供的命令

安装wget

brew install wget

git界面gitx-dev

在界面上选择安装命令行

cd到git仓库执行

gitx -all

smartySvn

升级svn到1.8

brew search subversion

brew tap homebrew/versions

brew install subversion18

svn --version

安装smartySvn

open working copy选择svn co的目录

安装node

官网下载安装

安装包的时候使用sudo

sudo npm install -g webpack

搭建php开发环境

安装nginx

brew install nginx --with-http2

配置目录 /usr/local/etc/nginx/

sudo nginx

sudo nginx -t

sudo nginx -s reload

安装php

PHP在mac下默认安装了,但是不好控制版本,用brew安装php5.6

brew update

brew tap homebrew/dupes

brew tap josegonzalez/homebrew-php

brew install php56 --with-fpm #Nginx

/usr/local/etc/php/5.6/php.ini

/usr/local/etc/php/5.6/php-fpm.conf

brew services start josegonzalez/php/php56

sudo php-fpm -D # 启动

sudo killall php-fpm # 关闭

安装mysql

brew install mysql

chown -R mysql:mysql /usr/local/var/mysql

chmod -R 755 /usr/local/var/mysql

mysql.server start

安装composer

手动下载 composer.phar

mv composer.phar /usr/local/bin/composer

sudo chmod +x /usr/local/bin/composer

composer -v

问题:

Your configuration does not allow connection to ... secure-http for details.

处理:

composer config -g secure-http false

安装memcached扩展

brew install memcached

/usr/local/opt/memcached/bin/memcached -d -m 64 -c 4096 -p 11210 -u www -t 10

/usr/local/opt/memcached/bin/memcached -d -m 256 -c 4096 -p 11211 -u www -t 10

killall memcached

pkill -9 memcached

brew install php56-memcached

安装其他扩展

brew install php56-mcrypt

brew install php56-xdebug

安装impala odbc

cd /usr/local/Cellar/unixodbc/2.3.4/etc

odbc.ini

[ODBC Data Sources]

Cloudera Impala DSN = Cloudera Impala ODBC Driver

[Cloudera Impala DSN]

Driver=/opt/cloudera/impalaodbc/lib/universal/libclouderaimpalaodbc.dylib

HOST = 192.168.8.207

PORT = 21050

AuthMech = 0

[Impala]

Description = ODBC for impala

Driver=/opt/cloudera/impalaodbc/lib/universal/libclouderaimpalaodbc.dylib

[ODBC Drivers]

Impala = Installed

[ODBC Data Sources]

Cloudera Impala DSN = Cloudera Impala ODBC Driver

[Cloudera Impala DSN]

Driver=/opt/cloudera/impalaodbc/lib/universal/libclouderaimpalaodbc.dylib

HOST = 192.168.8.207

PORT = 21050

AuthMech = 0

odbcinst.ini

[Impala]

Description = ODBC for impala

Driver=/opt/cloudera/impalaodbc/lib/universal/libclouderaimpalaodbc.dylib

[ODBC Drivers]

Impala = Installed

安装java

官网下载安装

锁屏快捷键

CTRL + SHIFT + Power

zsh配置

mac自带了zsh

安装oh my zsh

git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh

cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc

配置

vi ~/.zshrc

加上配置

alias cls='clear'

alias ll='ls -l'

alias la='ls -a'

alias vi='vim'

alias javac="javac -J-Dfile.encoding=utf8"

alias grep="grep --color=auto"

alias -s html=mate # 在命令行直接输入后缀为 html 的文件名,会在 TextMate 中打开

alias -s rb=mate # 在命令行直接输入 ruby 文件,会在 TextMate 中打开

alias -s py=vi # 在命令行直接输入 python 文件,会用 vim 中打开,以下类似

alias -s js=vi

alias -s c=vi

alias -s java=vi

alias -s txt=vi

alias -s gz='tar -xzvf'

alias -s tgz='tar -xzvf'

alias -s zip='unzip'

alias -s bz2='tar -xjvf'

oh my zsh 提供了数十种主题,相关文件在~/.oh-my-zsh/themes目录下

修改默认主题robbyrussell

将`%c`改为`%d`

c表示当前目录,d表示绝对路径

安装autojump

brew install autojump

在.bash_profile和.zshrc加上

[[ -s $(brew --prefix)/etc/profile.d/autojump.sh ]] && . $(brew --prefix)/etc/profile.d/autojump.sh

安装ctags

brew install ctags

vim配置

vi ~/.vimrc

let Tlist_Ctags_Cmd='/usr/local/bin/ctags'

显示隐藏文件

使用终端,Finder需要重启才能应用修改,在终端中接着输入

defaults write com.apple.finder AppleShowAllFiles -bool true

killall Finder

恢复隐藏不可见,在终端中输入以下代码并回车

defaults write com.apple.finder AppleShowAllFiles -bool false

killall Finder

软件工具

dash 常见语言框架API文档

cakebrew brew的界面管理工具

cheatSheet 快捷键查看工具

licecap git录制工具

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Monodyee/article/detail/187843
推荐阅读
相关标签
  

闽ICP备14008679号