Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have nginx and php5-fpm running on ubuntu 11.04. I have installed phpmyadmin but im having trouble accessing it. I would like to access it via http://localhost/phpmyadmin

I've used all the default locations for the nginx, php5, and phpmyadmin installs.

I'm being directed to use the block below by the blog guide im following, but im not sure what to change to get it to point how im wanting it to.

server {

    listen   80;
    server_name php.example.com; // <-I know i need to edit this, but not sure to what.

    access_log /var/log/nginx/localhost.access.log;

    root   /usr/share/phpmyadmin;
    index  index.php;

    location / {
    try_files $uri $uri/ @phpmyadmin;

    location @phpmyadmin {
    fastcgi_param SCRIPT_FILENAME /usr/share/phpmyadmin/index.php;
    include /etc/nginx/fastcgi_params;
    fastcgi_param SCRIPT_NAME /index.php;

    # pass the PHP scripts to FastCGI server listening on
    location ~ \.php$ {
    fastcgi_index  index.php;
    fastcgi_param  SCRIPT_FILENAME  /usr/share/phpmyadmin$fastcgi_script_name;
    include        fastcgi_params;
share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.