1 先安装homebrew;
执行:cd /usr/local;
非root用户执行:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
执行:
brew update
already up-to-date 表示成功!
可能出现错误,打开xcode,点击同意;
更过关于homebrew请到官网:
http://brew.sh/index_zh-cn.html
2 安装mysql
$ brew install mysql
3 安装php
添加brew的PHP扩展库:
brew update brew tap homebrew/dupes brew tap josegonzales/homebrew-php
查看php5.5的选项
brew options php55
执行安装 ,后面选项可以调整
brew install php55 --with-fpm --with-gmp --with-imap --with-tidy --with-debug --with-mysql --with-libmysql --with-apache
查看还有哪些扩展可以安装,然后执行brew install php55-XXX就可以了
brew search php55
开机自动启动
ln -sfv /usr/local/opt/php55/*.plist ~/Library/LaunchAgents launchctl load ~/Library/LaunchAgents/homebrew.mxcl.php55.plist
linux 查看apache版本 rpm -qi httpd
Mac 查看apache版本 suso apachectl -v
Linux上配置端口方式是这样的:
<VirtualHost *:1000>
DocumentRoot "/Users/lijundong/Documents"
ErrorLog /Users/lijundong/Documents/logs
</VirtualHost>
<Directory '/Users/lijundong/Documents'>
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Mac上配置端口是这样的
<VirtualHost *:1000>
ServerName my.document.com
DocumentRoot "/Users/lijundong/Documents"
DirectoryIndex index.html index.php
<Directory "/Users/lijundong/Documents">
Options -Indexes +FollowSymlinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
之前一直出错是因为版本不同 配置配置的方式不同。