sh OS X 10.12 Sierra,Apache,MySQL,PHP 5.6,(MAMP)Homebrew Dev Setup

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh OS X 10.12 Sierra,Apache,MySQL,PHP 5.6,(MAMP)Homebrew Dev Setup相关的知识,希望对你有一定的参考价值。

# From http://www.iyware.com/osx-yosemite-mamp-homebrew-development-setup/

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

# Tap Repos
brew tap homebrew/dupes
brew tap homebrew/versions
brew tap homebrew/homebrew-php
brew tap homebrew/apache

# Update Homebrew & Upgrade Packages
brew update && brew upgrade

# Macintosh
brew install git
brew install openssl
ssh-keygen -t rsa -C “email@address.invalid”
ssh-add ~/.ssh/id_rsa

# Apache
sudo apachectl stop
sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist 2>/dev/null
brew install httpd24 --with-privileged-ports --with-brewed-openssl --with-mpm-event --with-http2

sudo cp -v /usr/local/Cellar/httpd24/2.4.10/homebrew.mxcl.httpd24.plist /Library/LaunchDaemons
sudo chown -v root:wheel /Library/LaunchDaemons/homebrew.mxcl.httpd24.plist
sudo chmod -v 644 /Library/LaunchDaemons/homebrew.mxcl.httpd24.plist
sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.httpd24.plist
sudo httpd -k start

# MySQL
brew install mysql
ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
mysqladmin -u root password “NEWPASSWORD”

# PHP
brew install php56 --build-from-source --with-thread-safety --with-httpd24 --with-mssql --with-pear --with-homebrew-curl --with-phpdbg --with-debug --with-homebrew-libxslt

chmod -R ug+w /usr/local/Cellar/php56/5.6.2/lib/php
pear config-set php_ini /usr/local/etc/php/5.6/php.ini
printf '\nAddHandler php5-script .php\nAddType text/html .php' >> /usr/local/etc/apache2/2.4/httpd.conf
perl -p -i -e 's/DirectoryIndex index.html/DirectoryIndex index.php index.html/g' /usr/local/etc/apache2/2.4/httpd.conf
printf '\nexport PATH="$(brew --prefix homebrew/php/php56)/bin:$PATH"' >> ~/.profile

# Dev Stuff
brew install composer
brew install node

以上是关于sh OS X 10.12 Sierra,Apache,MySQL,PHP 5.6,(MAMP)Homebrew Dev Setup的主要内容,如果未能解决你的问题,请参考以下文章

如何在 Mac OS Sierra 10.12 上安装 Nokogiri

从 OS Sierra 10.12 上的终端分段错误 11 错误重新签署 IPA

mac os下的Apache配置 macOS Sierra 10.12

sh Mac OS X High Sierra / PHP Apache httpd配置节点NPM

macOS 10.12 Sierra 上的捆绑错误

Jenkins 无法在 macOS 10.12 (Sierra) 上启动