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
 
摘自:http://www.jb51.net/article/53850.htm
http://www.cnblogs.com/zjl2015/p/5264633.html
 
mac中本就安装好了apache 
配置文件在/etc/apache2/httpd.config
初始根目录在/Library/WebServer/Document/中
修改http.config 文件需要管理员权限,
执行
sudo su
...#: 为超管权限 ,现在可以修改该文件的默认根目录和选择加载php.ini配置
#LoadModule php5_module libexec/apache2/libphp5.so
将前面#去掉
重启apache
sudo apachectl restart
即可
 
载自:http://www.th7.cn/Program/php/201308/148040.shtml
 
 
mac配置端口
我的mac上apache版本是2.4版本 
Linux服务器apache版本是2.2版本

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>

之前一直出错是因为版本不同 配置配置的方式不同。

最新文章

  1. Arduino uno LED灯实验
  2. Error:Execution failed for task &#39;:app:transformClassesWithInstantRunForDebug&#39;. &gt; java.lang.ClassNotFoundException: io.realm.RealmObject
  3. python 练习多级菜单思路
  4. [PHP]array_map与array_column之间的关系
  5. placeholder在ie浏览器里不显示的问题解决
  6. POJ 1287 Networking (最小生成树)
  7. 一步一步ITextSharp 低级操作函数使用
  8. jQuery之手风琴图片
  9. 【问题汇总】ListView的FooterView设置可见性的问题
  10. spm3 基本
  11. LeetCode OJ 54. Spiral Matrix
  12. iOS开发——打包静态库与Framework
  13. 5.volatile的应用
  14. Now trying to drop the old temporary tablespace, the session hangs.
  15. k8s应用机密信息与配置管理(九)--技术流ken
  16. Ubuntu软件的安装与删除
  17. 使用AS-REP Roasting和kerberoasting攻击kerberos
  18. zabbix监控短信息接口是否正常
  19. python初级 2 字符串格式化
  20. [Ubuntu] LightDM 轻量级桌面显示管理器

热门文章

  1. iOS基于MBProgressHUD的二次封装,一行搞定,使用超简单
  2. PHP生成器Generators
  3. 32-bit Assembly on x86_64 Linux (Use Nasm and ld&amp;gcc)
  4. 使用Windows Azure的VM安装和配置CDH搭建Hadoop集群
  5. C++11 之 scoped enum
  6. python笔记-调用eval函数出现invalid syntax错误
  7. NOIP2012pj摆花[DP 多重背包方案数]
  8. java分层开发
  9. 炮(棋盘DP)
  10. 杭电OJ——1198 Farm Irrigation (并查集)