Homebrew安装 ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
node.js安装: brew install node -g brew install npm -g #npm是node.js的包管理器nginx和mysql安装: brew install nginx brew install mysql
php插件安装:
1.拷贝redis.so,mcrypt.so到/etc/phpExt(可以为其他目录)
2.执行brew install libmcrypt
3.修改php.ini。sudo cp /etc/php.ini.default /etc/php.ini,sudo vi php.ini找到extension的位置,增加so配置: extension=/etc/phpExt/redis.so extension=/etc/phpExt/mcrypt.so date.timezone = Asia/Shanghai
4.要显示php的所有错误信息,修改php.ini的error_reporting和display_errors配置项。
php项目工程部署:
1.用git下载代码,如:git clone git@git.zjseek.com.cn:flow/flow-manager.git $localpath
npm install
2.如果项目工程有gulpfile.js的,则在工程目录下运行gulp。如果gulp未安装,则执行“npm install gulp”命令安装。
3.修改apache配置文件/etc/apache2/httpd.conf,放开以下Module: LoadModule alias_module libexec/apache2/mod_alias.so LoadModule rewrite_module libexec/apache2/mod_rewrite.so LoadModule php5_module libexec/apache2/libphp5.so
4.修改网站所有文件的根目录: DocumentRoot "/Users/chengyuexue/Workspace/"AllowOverride All5.设置工程的域名及对应的路径 Listen 80DocumentRoot "/Users/chengyuexue/Workspace/Flow/flow-manager"
ServerName test.liulianggo.comDocumentRoot "/Users/chengyuexue/Workspace/Flow/flow-naruto"
ServerName test.flownaruto.comDocumentRoot "/Users/chengyuexue/Workspace/Flow/flow-pms-v2"
ServerName test.flowpmsv2.comDocumentRoot "/Users/chengyuexue/Workspace/Flow-Surrounding/flow-red-packet"
ServerName test.flowredpacket.com
5.在/etc/hosts配置域名(如:test.flownaruto.com)指定到127.0.0.1。
6.项目工程创建log目录及dev.lock文件,并把权限设为可写
7.项目工程创建.htaccess文件。RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
8.重启apache: sudo /usr/sbin/apachectl restart