Question

Installed PhpMyAdmin On Nginx For Drupal But I Get 404 Error

Posted January 8, 2015 3.1k views

I created a new droplet with the Drupal application and the DO system chose the nginx web server. I needed to install phpmyadmin so I followed the DO tutorial on how to setup phpmyadmin on nginx and installed phpmyadmin and also create a symbolic link it ( sudo ln -s /usr/share/phpmyadmin /usr/share/nginx/html ) but going to http://my-ip/phpmyadmin gives a 404 error.

I have never used nginx before, what can I do to fix this please. Thanks.

1 comment
  • I have to ask, did you restart nginx?

    $ sudo service nginx restart
    

    As well phpMyAdmin is based of php. Did you configure php in your server {} block?

    $ sudo nano /etc/nginx/sites-available/default
    

    Check for location ~\.php$ { }

    server {
        . . .
        . . .
        other configs....
        . . .
        . . .
        location ~ \.php$ {
            try_files $uri =404;
            fastcgi_split_path_info ^(.+\.php)(/.+)$;
            fastcgi_pass unix:/var/run/php5-fpm.sock;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include fastcgi_params;
        }
    }
    

    Then restart:

    $ sudo service nginx restart
    

    I installed nginx & php my self and did not use the automatic installer so I’m not 100% sure how it differs.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

1 answer

This question was answered by @FireDart:

I have to ask, did you restart nginx?

$ sudo service nginx restart

As well phpMyAdmin is based of php. Did you configure php in your server {} block?

$ sudo nano /etc/nginx/sites-available/default

Check for location ~\.php$ { }

server {
   . . .
   . . .
   other configs....
   . . .
   . . .
   location ~ \.php$ {
       try_files $uri =404;
       fastcgi_split_path_info ^(.+\.php)(/.+)$;
       fastcgi_pass unix:/var/run/php5-fpm.sock;
       fastcgi_index index.php;
       fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
       include fastcgi_params;
   }
}

Then restart:

$ sudo service nginx restart

I installed nginx & php my self and did not use the automatic installer so I’m not 100% sure how it differs.

View the original comment

Submit an Answer