brew nginx mysql phpmyadmin_mac系统下如何配置php+nginx+mysql+phpmyadmin

摘要:mac 10.9系统如何配置php+nginx+mysql+phpmyadmin,网上看了好多教程安装Brewruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"安装nginx,mysql,phpmyadminbrew install nginx mys

mac 10.9系统如何配置php+nginx+mysql+phpmyadmin,网上看了好多教程

安装Brew

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

安装nginx,mysql,phpmyadmin

brew install nginx mysql phpmyadmin

安装特定版本php(以5.6为例)

brew tap homebrew/php

brew install php56

设置开机启动

brew tap homebrew/services

sudo brew services start php56

sudo brew services start nginx

sudo brew services start mysql

基本设置mysql

mysql_secure_installation

设置nginx(在文件在/usr/local/etc/nginx/nginx.conf中插入)server {

listen       80;

server_name  localhost;

location /pma {

alias /usr/local/share/phpmyadmin/;

try_files $uri $uri/ /index.php;

disable_symlinks off;

index index.php;

location ~ ^/pma(.+\.php)$ {

alias /usr/local/share/phpmyadmin$1;

fastcgi_pass 127.0.0.1:9000;

include fastcgi_params;

fastcgi_param SCRIPT_FILENAME /usr/local/share/phpmyadmin$1;

fastcgi_intercept_errors        on;

}

}

location / {

root   /srv/www;

index  index.php index.html index.htm;

try_files $uri $uri/ /index.php?$query_string;

}

location ~ \.php$ {

root           /srv/www;

fastcgi_pass   127.0.0.1:9000;

fastcgi_index  index.php;

fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;

include        fastcgi_params;

}

}

nginx重启

sudo nginx -s reload

在浏览器输入localhost/pma应该就ok了

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值