Setting up phpmyadmin with nginx

Assuming you already get php, php5-fpm and nginx running on your system.
Steps:
1. sudo apt-get install phpmyadmin
2. You can now find phpMyAdmin in the /usr/share/phpmyadmin/ directory. Now we must configure our vhost so that nginx can find phpMyAdmin in that directory.
Open /etc/nginx/sites-available/www.example.com.vhost...
and add the following code into server{...}

       location /phpmyadmin {
               root /usr/share/;
               index index.php index.html index.htm;
               try_files $uri $uri/ /index.php index.php;

               location ~ \.php$ {
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                # fastcgi_pass 127.0.0.1:9000;
                # With php5-fpm:
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;
                include fastcgi_params;
                }
        }

        location /phpMyAdmin {
               rewrite ^/* /phpmyadmin last;
        }

0 comments

Popular Posts

无觅相关文章插件,迅速提升网站流量