osx snow leopard下用homebrew 安装php5.3 + php-fpm

最近要给客户定制一个PHP的论坛, 我本来是python控, 所以机器上就没有PHP的运行环境, 于是开始折腾, 本来在centos上配置Nginx + PHP-fpm挺简单的, 直接一路yum install就可以了, 这下到mac上就有点麻烦, 虽然macports上有PHP, 但是如果安装PHP-fpm的话需要hack的方法, 为了不麻烦, 爬文看到有使用homebrew的方式使用第三方的formula可以安装, 下面开动。 

 

如果你没用过homebrew, 那么移步Homebrew的网站看看, 安装起来很简单, 因为它就是一堆ruby的脚本, 所以你直接在terminal里键入:

ruby -e "$(curl -fsSLk https://gist.github.com/raw/323731/install_homebrew.rb)" 

既然你在玩这个, 假定你已经装了xcode, 3或者4都可以。 接下来就是下载PHP的formula, 

  1. curl -O https://github.com/ampt/homebrew/raw/PHP/Library/Formula/PHP.rb
  2. mv PHP.rb `brew --prefix`/Library/Formula

 

如果你想看PHP的安装选项, 可以使用

  1. brew options PHP

 

嗯, 现在可以安装了, 我只需要PHPPHPMysqL, 就这样:

  1. brew install PHP --with-MysqL --with-fpm

 这样基本上就可以了。 

转载于:https://www.cnblogs.com/Stephen/archive/2011/04/09/Mac_SNow_Leopard_Homebrew_Install_PHP.html

相关文章

最近做自动化测试时,深感自己对前端涉猎太少,加上对这块比...
homebrew本身就是一个git仓库。使用homebrew安装软件包时,会...
一、Homebrew安装、卸载等命令Homebrew的安装和卸载都非常简...
在mac系统中,使用homebrew可以很方便的管理包。按照官网的说...
我按照说明从这里使用brew安装mysqlhttps://gist.github.com...
我在macOS10.12.4上安装了nginx1.10.3和php5.5.38作为开发服...