Mac os 10.8 一键安装PHP、Mysql、Nginx
基于HomeBrew安装,如果没有安装Brew,请先执行安装命令。
[shell]ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"[/shell]
[shell]
# Install nginx
brew install nginx
# Create a link to autostart nginx when the system starts
mkdir -p ~/Library/LaunchAgents
cp /usr/local/Cellar/nginx/1.*/*.nginx.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/*.nginx.plist
# Cancel the self-starting
launchctl unload -w ~/Library/LaunchAgents/org.nginx.nginx.plist
# Install MySQL
brew install mysql
cp /usr/local/Cellar/mysql/5.*/*.mysql.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/*.mysql.plist
#Install Percona
brew install percona-server brew link percona-server unset TMPDIR mysql_install_db –verbose –user=`whoami` –basedir="$(brew –prefix percona-server)" –datadir=/usr/local/var/percona –tmpdir=/tmp
mkdir -p ~/Library/LaunchAgents
cp /usr/local/opt/percona-server/homebrew.mxcl.percona-server.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.percona-server.plist
#Install PHP-fpm
brew tap josegonzalez/php
brew update
brew install –without-apache –with-fpm –with-mysql php54
sudo cp `brew –prefix php54`/homebrew-php.josegonzalez.php54.plist /Library/LaunchAgents/
sudo launchctl load -w /Library/LaunchAgents/homebrew-php.josegonzalez.php54.plist
php-fpm -v
sudo mv /usr/sbin/php-fpm /usr/sbin/php-fpm.bak
sudo ln -s /usr/local/Cellar/php54/5.4.11/sbin/php-fpm /usr/sbin/php-fpm
php-fpm -v
php -v
sudo mv /usr/bin/php /usr/bin/php.bak
sudo ln -s /usr/local/bin/php /usr/bin/php
php -v echo ‘export PATH=$PATH:/usr/local/sbin’ >> ~/.zshrc
# or ~/.bash_profile
[/shell]
levi提供了一个更详细的方案,就不重复造车了。
http://levi.cg.am/?p=3129
我曾经写过一篇比较完整的经验,详细参见http://levi.cg.am/?p=3129