macOS High Sierra 使用系统自带的Apache

2018-08-21  本文已影响0人  GadflyBSD

1. 禁用系统完整性保护System Integrity Protection (SIP)

  1. 重启系统
  2. 按住Command + R (重新亮屏之后就开始按,象征地按几秒再松开,出现苹果标志,ok)
  3. 菜单“实用工具” ==>> “终端” ==>> 输入 csrutil disable
  4. 执行后会输出:
    Successfully disabled System Integrity Protection. Please restart the machine for the changes to take effect.
  5. 再次重启系统
  6. 禁止掉SIP后,就可以顺利的安装了,当然装完了以后你可以重新打开SIP,方法同上,只是命令是 csrutil enable

2. Homebrew安装 和 通过 brew 安装 autoconf

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install autoconf
brew install libmemcached

3. 安装Xcode环境和命令行开发工具

xcode-select --install

4. 安装PEAR 和 PECL

cd /usr/lib/php
curl -O http://pear.php.net/go-pear.phar
sudo php -d detect_unicode=0 go-pear.phar
sudo pear upgrade-all
sudo pecl channel-update pecl.php.net

执行以上命令后会进行安装过程,会有一些配置选项

  • 输入1,回车,配置pear路径为:/usr/local/pear
  • 输入4,回车,配置命令路径为:/usr/local/bin
  • 回车两次,其他让其默认,安装完成
  • 可以通过命令检查pear安装是否成功 pear version

5. 安装pkg-config

brew install pkg-config
brew install ImageMagick
brew install pcre
brew install libevent
brew install libmemcached
brew install openssl
brew install mcrypt 
brew install gearmand
brew install hiredis

5. 安装PHP扩展库

6. 配置mysql并安装

git clone https://github.com/mysqludf/lib_mysqludf_sys.git
cd lib_mysqludf_sys
sudo cp lib_mysqludf_sys.so /usr/local/mysql/lib/plugin/
sudo chmod 777 /usr/local/mysql/lib/plugin/lib_mysqludf_sys.so
/usr/local/mysql/bin/mysql -uroot -p

7. 安装 Cordova 开发环境

一、安装node.js

从 nodejs.org 中下载Node.js for Mac 安装包,也就是一个6M多的pkg文件,下载之后点击安装即可。它将在你的机器上安装 Node.js 和 npm (node package manager).安装成功后你就可以使用 node 和 npm 命令了。

二、、安装ANT

brew install ant

三、安装android-sdk-tools和相应的SDK

四、配置环境变量

五、安装 cordova、Ionic等

npm --registry http://registry.cnpmjs.org info underscore
sudo npm install -g phonegap
sudo npm install -g minimatch
sudo npm install -g cordova ionic
sudo npm install -g ios-sim
sudo npm install -g ios-deploy --unsafe-perm=true
上一篇 下一篇

猜你喜欢

热点阅读