nginx 配置phpmyadmin

下载

phpadmin 下载下来是一个zip文件,解压到特定目录,并重新命名例如:

/Users/crlt_/Tools/phpMyAdmin

配置

nginx配置文件

vim /usr/local/etc/nginx/servers/localhost-php-myadmin.conf

配置文件内容:

server {
 listen 2234;#监听的端口
 server_name localhost;
 access_log /Users/crlt_/Tools/phpMyAdmin/access.log ;

 location / {
  root /Users/crlt_/Tools/phpMyAdmin/;# phpmyAdmin解压目录
  index index.php;
 }

 location ~ \.php$ {
  root /Users/crlt_/Tools/phpMyAdmin/;


  fastcgi_pass  127.0.0.1:9999;#这个端口号是php-fpm的端口,默认为9000
# fastcgi_pass  unix:/var/run/php-fpm/php-fpm.sock;
  fastcgi_index index.php;
  fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  include fastcgi_params;
 }

 location ~ /\.ht {
  deny all;
 }
}

你可能感兴趣的:(php)