1. 安装brew
curl -LsSf http://github.com/mxcl/homebrew/tarball/master | sudo tar xvz -C/usr/local --strip 1
brew update
sudo chown -R $(whoami) /usr/local
brew update
rm -r -f /usr/local/share/doc/homebrew
brew update
2. 安装nginx
brew search nginx
brew install nginx
Docroot is: /usr/local/var/www
The default port has been set in /usr/local/etc/nginx/nginx.conf to 8080 so that
nginx can run without sudo.
nginx will load all files in /usr/local/etc/nginx/servers/.
/usr/local/Cellar/nginx/1.12.1: 23 files, 1MB
基本命令:
nginx -ve
sudo nginx
sudo nginx -s reload
sudo nginx -s stop
参考:http://www.cnblogs.com/cheemon/p/5638394.html
3. 安装php
安装php7.0.15
brew install homebrew/php/php70
brew install homebrew/php/php70-mcrypt
brew install homebrew/php/php70-redis
brew install homebrew/php/php70-msgpack
brew install homebrew/php/php70-memcached
安装php后可执行文件所在路径(-v ):
/usr/local/bin/php -v
/usr/local/bin/phpize -v
/usr/local/bin/php-config -v
/usr/local/sbin/php-fpm -v
重启再次查看环境
启动fpm:
sudo /usr/local/Cellar/php70/7.0.22_14/sbin/php70-fpm start
sudo nginx
/usr/local/sbin/php-fpm(老版本)
sudo pkill php-fpm
参考:
php 安装
php composer.phar require johnlui/aliyun-oss